Farbflash projects: Imaging lingo table | 3-D scene list | Find all | Handler menu | Lingo message window

Ignore:
Timestamp:
03/23/09 10:16:14 (3 years ago)
Author:
alex
Message:

moved helper handlers used by svn and alex utitlies to alex_utilities

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lingosource/castlib1/svn_Utilities.ls

    r230 r232  
    285285 
    286286-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    287  
    288 on mFindUnixAppInPath me, whichBinaryName 
    289    
    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 end 
    299  
    300  
    301 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    302287-- this can be used to open the corresponding script in bbedit and svn compare it to head 
    303288 
     
    981966end 
    982967 
    983  
    984 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    985  
    986 on mRemoveWhiteSpaces me, theText 
    987    
    988   if mCheckForXtra(me, "Pregex") = 1 then 
    989      
    990     theText = [theText] 
    991     PRegEx_Replace(theText, "\s" , "g", "") 
    992     return theText[1] 
    993      
    994   else 
    995     whitespaces = [" ", RETURN] 
    996     repeat with ws = count(whitespaces) down to 1 
    997       theText = mReplaceChunk(me, theText, whitespaces[ws], "") 
    998     end repeat 
    999   end if 
    1000    
    1001   return theText 
    1002    
    1003 end 
    1004 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    1005  
    1006 -- using offset() -> no pregex 
    1007 on mReplaceChunk me, srcText, fromChunk, toChunk 
    1008    
    1009   stelle = offset(fromChunk, srcText) 
    1010    
    1011   if stelle then 
    1012      
    1013     len = fromChunk.length 
    1014     newtext = "" 
    1015     replText = toChunk 
    1016      
    1017     repeat while stelle 
    1018        
    1019       if stelle > 1 then put char 1 to (stelle - 1) of srcText & replText after newtext 
    1020       else put replText after newtext 
    1021        
    1022       delete char 1 to (stelle + len - 1) of srcText 
    1023        
    1024       stelle = offset(fromChunk, srcText) 
    1025        
    1026       if stelle = 0 then put srcText after newtext 
    1027        
    1028     end repeat 
    1029      
    1030   else -- no match 
    1031      
    1032     return srcText 
    1033   end if 
    1034    
    1035   return newtext 
    1036 end 
    1037  
    1038  
    1039  
    1040968-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    1041969 
     
    25372465end 
    25382466 
    2539 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    2540  
    2541 on getCastlibList me, selectionList, defaultCLNum 
    2542    
    2543   castlibList = 0 
    2544    
    2545   if symbolP(selectionList) then 
    2546     -- #all 
    2547     clnum = the number of castlibs 
    2548     castlibList = [] 
    2549     repeat with n = 1 to clnum 
    2550       castlibList.add(n) 
    2551     end repeat 
    2552      
    2553   else 
    2554      
    2555     selectionList = string(selectionList) 
    2556     if length(selectionList) > 0 then 
    2557        
    2558       offs = offset("'", selectionList) 
    2559       repeat while offs > 0 
    2560         put QUOTE into char offs of selectionList 
    2561         offs = offset("'", selectionList) 
    2562       end repeat 
    2563        
    2564       if char 1 of selectionList <> "[" then put "[" before selectionList 
    2565       if the last char of selectionList <> "]" then put "]" after selectionList 
    2566        
    2567       selectionList = value(selectionList) 
    2568       if listP(selectionList) then 
    2569         clnum = the number of castlibs + 1 
    2570         castlibList = [] 
    2571         selectionListCnt = count(selectionList) 
    2572         repeat with n = 1 to selectionListCnt 
    2573            
    2574           cl = castlib(selectionList[n]) 
    2575           if ilk(cl) = #castlib then 
    2576             int = cl.number 
    2577             if castlibList.getPos(int) < 1 then 
    2578               castlibList.add(int) 
    2579             end if 
    2580           else 
    2581             int = integer(selectionList[n]) 
    2582             if integerP(int) then 
    2583               if clnum > int then 
    2584                 if castlibList.getPos(int) < 1 then castlibList.add(int) 
    2585               end if 
    2586             end if 
    2587           end if 
    2588         end repeat 
    2589       end if 
    2590     end if 
    2591   end if 
    2592    
    2593   if not(listP(castlibList)) then castlibList = [] 
    2594    
    2595   if count(castlibList) < 1 then 
    2596     if ilk(defaultCLNum) = #integer then 
    2597       castlibList.add(defaultCLNum) 
    2598     else if listP(defaultCLNum) then 
    2599       castlibList = defaultCLNum 
    2600     end if 
    2601   end if 
    2602    
    2603   return castlibList 
    2604 end 
    26052467 
    26062468-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
Note: See TracChangeset for help on using the changeset viewer.