- Timestamp:
- 03/23/09 10:16:14 (3 years ago)
- Location:
- trunk/lingosource/castlib1
- Files:
-
- 3 edited
-
alexUtilities.ls (modified) (1 diff)
-
subversion_version_field.txt (modified) (1 diff)
-
svn_Utilities.ls (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lingosource/castlib1/alexUtilities.ls
r230 r232 3569 3569 end 3570 3570 3571 3572 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 3573 3574 on mRemoveWhiteSpaces me, theText 3575 3576 if mCheckForXtra(me, "Pregex") = 1 then 3577 3578 theText = [theText] 3579 PRegEx_Replace(theText, "\s" , "g", "") 3580 return theText[1] 3581 3582 else 3583 whitespaces = [" ", RETURN] 3584 repeat with ws = count(whitespaces) down to 1 3585 theText = mReplaceChunk(me, theText, whitespaces[ws], "") 3586 end repeat 3587 end if 3588 3589 return theText 3590 3591 end 3592 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 3593 3594 -- using offset() -> no pregex 3595 on mReplaceChunk me, srcText, fromChunk, toChunk 3596 3597 stelle = offset(fromChunk, srcText) 3598 3599 if stelle then 3600 3601 len = fromChunk.length 3602 newtext = "" 3603 replText = toChunk 3604 3605 repeat while stelle 3606 3607 if stelle > 1 then put char 1 to (stelle - 1) of srcText & replText after newtext 3608 else put replText after newtext 3609 3610 delete char 1 to (stelle + len - 1) of srcText 3611 3612 stelle = offset(fromChunk, srcText) 3613 3614 if stelle = 0 then put srcText after newtext 3615 3616 end repeat 3617 3618 else -- no match 3619 3620 return srcText 3621 end if 3622 3623 return newtext 3624 end 3625 3626 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 3627 3628 on mFindUnixAppInPath me, whichBinaryName 3629 3630 binaryPath = [] 3631 3632 binaryPath = mDoShellCmd(me, "for thisBinPath in /usr/bin /bin /usr/sbin /sbin /usr/local/sbin /usr/local/bin /opt/sbin /opt/bin /opt/local/sbin /opt/local/bin /sw/bin /sw/sbin ; do find $thisBinPath -name " & whichBinaryName & " ; done", RETURN, 0, 1) 3633 3634 if count(binaryPath) > 0 then return binaryPath[1] 3635 3636 return "" 3637 3638 end 3639 3640 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 3641 3642 on getCastlibList me, selectionList, defaultCLNum 3643 3644 castlibList = 0 3645 3646 if symbolP(selectionList) then 3647 -- #all 3648 clnum = the number of castlibs 3649 castlibList = [] 3650 repeat with n = 1 to clnum 3651 castlibList.add(n) 3652 end repeat 3653 3654 else 3655 3656 selectionList = string(selectionList) 3657 if length(selectionList) > 0 then 3658 3659 offs = offset("'", selectionList) 3660 repeat while offs > 0 3661 put QUOTE into char offs of selectionList 3662 offs = offset("'", selectionList) 3663 end repeat 3664 3665 if char 1 of selectionList <> "[" then put "[" before selectionList 3666 if the last char of selectionList <> "]" then put "]" after selectionList 3667 3668 selectionList = value(selectionList) 3669 if listP(selectionList) then 3670 clnum = the number of castlibs + 1 3671 castlibList = [] 3672 selectionListCnt = count(selectionList) 3673 repeat with n = 1 to selectionListCnt 3674 3675 cl = castlib(selectionList[n]) 3676 if ilk(cl) = #castlib then 3677 int = cl.number 3678 if castlibList.getPos(int) < 1 then 3679 castlibList.add(int) 3680 end if 3681 else 3682 int = integer(selectionList[n]) 3683 if integerP(int) then 3684 if clnum > int then 3685 if castlibList.getPos(int) < 1 then castlibList.add(int) 3686 end if 3687 end if 3688 end if 3689 end repeat 3690 end if 3691 end if 3692 end if 3693 3694 if not(listP(castlibList)) then castlibList = [] 3695 3696 if count(castlibList) < 1 then 3697 if ilk(defaultCLNum) = #integer then 3698 castlibList.add(defaultCLNum) 3699 else if listP(defaultCLNum) then 3700 castlibList = defaultCLNum 3701 end if 3702 end if 3703 3704 return castlibList 3705 end 3706 -
trunk/lingosource/castlib1/subversion_version_field.txt
r230 r232 1 r23 11 r233 -
trunk/lingosource/castlib1/svn_Utilities.ls
r230 r232 285 285 286 286 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 287 288 on mFindUnixAppInPath me, whichBinaryName289 290 binaryPath = []291 292 binaryPath = mDoShellCmd(me, "for thisBinPath in /usr/bin /bin /usr/sbin /sbin /usr/local/sbin /usr/local/bin /opt/sbin /opt/bin /opt/local/sbin /opt/local/bin /sw/bin /sw/sbin ; do find $thisBinPath -name " & whichBinaryName & " ; done", RETURN, 0, 1)293 294 if count(binaryPath) > 0 then return binaryPath[1]295 296 return ""297 298 end299 300 301 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx302 287 -- this can be used to open the corresponding script in bbedit and svn compare it to head 303 288 … … 981 966 end 982 967 983 984 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx985 986 on mRemoveWhiteSpaces me, theText987 988 if mCheckForXtra(me, "Pregex") = 1 then989 990 theText = [theText]991 PRegEx_Replace(theText, "\s" , "g", "")992 return theText[1]993 994 else995 whitespaces = [" ", RETURN]996 repeat with ws = count(whitespaces) down to 1997 theText = mReplaceChunk(me, theText, whitespaces[ws], "")998 end repeat999 end if1000 1001 return theText1002 1003 end1004 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1005 1006 -- using offset() -> no pregex1007 on mReplaceChunk me, srcText, fromChunk, toChunk1008 1009 stelle = offset(fromChunk, srcText)1010 1011 if stelle then1012 1013 len = fromChunk.length1014 newtext = ""1015 replText = toChunk1016 1017 repeat while stelle1018 1019 if stelle > 1 then put char 1 to (stelle - 1) of srcText & replText after newtext1020 else put replText after newtext1021 1022 delete char 1 to (stelle + len - 1) of srcText1023 1024 stelle = offset(fromChunk, srcText)1025 1026 if stelle = 0 then put srcText after newtext1027 1028 end repeat1029 1030 else -- no match1031 1032 return srcText1033 end if1034 1035 return newtext1036 end1037 1038 1039 1040 968 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1041 969 … … 2537 2465 end 2538 2466 2539 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx2540 2541 on getCastlibList me, selectionList, defaultCLNum2542 2543 castlibList = 02544 2545 if symbolP(selectionList) then2546 -- #all2547 clnum = the number of castlibs2548 castlibList = []2549 repeat with n = 1 to clnum2550 castlibList.add(n)2551 end repeat2552 2553 else2554 2555 selectionList = string(selectionList)2556 if length(selectionList) > 0 then2557 2558 offs = offset("'", selectionList)2559 repeat while offs > 02560 put QUOTE into char offs of selectionList2561 offs = offset("'", selectionList)2562 end repeat2563 2564 if char 1 of selectionList <> "[" then put "[" before selectionList2565 if the last char of selectionList <> "]" then put "]" after selectionList2566 2567 selectionList = value(selectionList)2568 if listP(selectionList) then2569 clnum = the number of castlibs + 12570 castlibList = []2571 selectionListCnt = count(selectionList)2572 repeat with n = 1 to selectionListCnt2573 2574 cl = castlib(selectionList[n])2575 if ilk(cl) = #castlib then2576 int = cl.number2577 if castlibList.getPos(int) < 1 then2578 castlibList.add(int)2579 end if2580 else2581 int = integer(selectionList[n])2582 if integerP(int) then2583 if clnum > int then2584 if castlibList.getPos(int) < 1 then castlibList.add(int)2585 end if2586 end if2587 end if2588 end repeat2589 end if2590 end if2591 end if2592 2593 if not(listP(castlibList)) then castlibList = []2594 2595 if count(castlibList) < 1 then2596 if ilk(defaultCLNum) = #integer then2597 castlibList.add(defaultCLNum)2598 else if listP(defaultCLNum) then2599 castlibList = defaultCLNum2600 end if2601 end if2602 2603 return castlibList2604 end2605 2467 2606 2468 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Note: See TracChangeset
for help on using the changeset viewer.
