Changeset 232 for trunk/lingosource/castlib1/svn_Utilities.ls
- Timestamp:
- 03/23/09 10:16:14 (3 years ago)
- File:
-
- 1 edited
-
trunk/lingosource/castlib1/svn_Utilities.ls (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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.
