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

Changeset 6 for trunk/lingosource


Ignore:
Timestamp:
08/30/07 14:36:26 (5 years ago)
Author:
alex
Message:

this time it should work better

Location:
trunk/lingosource
Files:
2 edited

Legend:

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

    r2 r6  
    32753275          ----------------------------------------- 
    32763276           
    3277            
    3278           mSaveToTextFile me, scrText, thisFolder & theDefaultName & ".ls" 
    3279            
    3280            
    3281           bmexp = 0 
    3282           if skipIcons <> 1 then 
    3283              
    3284             thumbmember = new(#bitmap) 
    3285             thumbmember.picture = memref.thumbnail 
    3286              
    3287             if thumbmember.width > 0 then 
    3288               bmexp = 1 
    3289               if baFileExists(thisFolder & theDefaultName & ".jpg") then baDeleteFile(thisFolder & theDefaultName & ".jpg") 
    3290               mExportBM me, thumbmember, thisFolder & theDefaultName & ".jpg", "jpg" 
     3277          if theDefaultName <> origname then 
     3278            alterText = "" 
     3279            snam = baShortFileName(thisFolder & origname & ".ls") 
     3280            if length(snam) > 0 then 
     3281              alterText = mGetTextFromFile(me, thisFolder & origname & ".ls") 
    32913282            end if 
    3292              
    3293             thumbmember.erase() 
    3294              
     3283          else 
     3284            alterText = mGetTextFromFile(me, thisFolder & theDefaultName & ".ls") 
    32953285          end if 
    32963286           
    3297            
    3298           if theDefaultName <> origname then 
    3299              
    3300             snam = baShortFileName(thisFolder & origname & ".ls") 
    3301             if length(snam) > 0 then baDeleteFile(snam) 
    3302             erg = baRenameFile(thisFolder & theDefaultName & ".ls", thisFolder & origname & ".ls") 
    3303             if erg <> 1 then put "Couldn't rename file " & thisFolder & theDefaultName & ".ls to " & thisFolder & origname & ".ls" 
    3304             if bmexp = 1 then 
    3305               snam = baShortFileName(thisFolder & origname & ".jpg") 
    3306               if length(snam) > 0 then baDeleteFile(snam) 
    3307               erg = baRenameFile(thisFolder & theDefaultName & ".jpg", thisFolder & origname & ".jpg") 
    3308               if erg <> 1 then put "Couldn't rename file " & thisFolder & theDefaultName & ".jpg to " & thisFolder & origname & ".jpg" 
     3287          if alterText <> scrText then 
     3288             
     3289            --------------------- compare without whitespaces: 
     3290            noChanges = (mRemoveWhiteSpaces(me, scrText&"") = mRemoveWhiteSpaces(me, alterText&"")) 
     3291             
     3292            if noChanges = 0 then 
     3293               
     3294               
     3295              mSaveToTextFile me, scrText, thisFolder & theDefaultName & ".ls" 
     3296               
     3297               
     3298              bmexp = 0 
     3299              if skipIcons <> 1 then 
     3300                 
     3301                thumbmember = new(#bitmap) 
     3302                thumbmember.picture = memref.thumbnail 
     3303                 
     3304                if thumbmember.width > 0 then 
     3305                  bmexp = 1 
     3306                  if baFileExists(thisFolder & theDefaultName & ".jpg") then baDeleteFile(thisFolder & theDefaultName & ".jpg") 
     3307                  mExportBM me, thumbmember, thisFolder & theDefaultName & ".jpg", "jpg" 
     3308                end if 
     3309                 
     3310                thumbmember.erase() 
     3311                 
     3312              end if 
     3313               
     3314               
     3315              if theDefaultName <> origname then 
     3316                 
     3317                snam = baShortFileName(thisFolder & origname & ".ls") 
     3318                if length(snam) > 0 then baDeleteFile(snam) 
     3319                erg = baRenameFile(thisFolder & theDefaultName & ".ls", thisFolder & origname & ".ls") 
     3320                if erg <> 1 then put "Couldn't rename file " & thisFolder & theDefaultName & ".ls to " & thisFolder & origname & ".ls" 
     3321                if bmexp = 1 then 
     3322                  snam = baShortFileName(thisFolder & origname & ".jpg") 
     3323                  if length(snam) > 0 then baDeleteFile(snam) 
     3324                  erg = baRenameFile(thisFolder & theDefaultName & ".jpg", thisFolder & origname & ".jpg") 
     3325                  if erg <> 1 then put "Couldn't rename file " & thisFolder & theDefaultName & ".jpg to " & thisFolder & origname & ".jpg" 
     3326                end if 
     3327                 
     3328              end if 
     3329               
     3330              if origname <> memname then 
     3331                put "Renamed member" && memref && "to" && origname & ". Scriptmember names must not be emoty or contain illegal characters (SPACE, /, :, \, &)" 
     3332              end if 
     3333               
    33093334            end if 
    3310              
    33113335          end if 
    33123336           
     
    33143338          infolist.setaprop(origname, [#scripttype: memref.scripttype, #comments: memref.comments, #membername: memname]) 
    33153339           
    3316           if origname <> memname then 
    3317             put "Renamed member" && memref && "to" && origname & ". Scriptmember names must not be emoty or contain illegal characters (SPACE, /, :, \, &)" 
    3318           end if 
    3319            
    33203340        end if 
     3341         
    33213342         
    33223343      end repeat 
     
    33273348  end repeat 
    33283349   
    3329    
    3330    
    3331 end 
     3350end 
     3351 
     3352-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     3353 
     3354on mRemoveWhiteSpaces me, theText 
     3355   
     3356  if mCheckForXtra(me, "Pregex") = 1 then 
     3357     
     3358    theText = [theText] 
     3359    PRegEx_Replace(theText, "\s" , "g", "") 
     3360    return theText[1] 
     3361     
     3362  else 
     3363    whitespaces = [" ", RETURN] 
     3364    repeat with ws = count(whitespaces) down to 1 
     3365      theText = mReplaceChunk(me, theText, whitespaces[ws], "") 
     3366    end repeat 
     3367  end if 
     3368   
     3369  return theText 
     3370   
     3371end 
     3372-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     3373 
     3374-- using offset() -> no pregex 
     3375on mReplaceChunk me, srcText, fromChunk, toChunk 
     3376   
     3377  stelle = offset(fromChunk, srcText) 
     3378   
     3379  if stelle then 
     3380     
     3381    len = fromChunk.length 
     3382    newtext = "" 
     3383    replText = toChunk 
     3384     
     3385    repeat while stelle 
     3386       
     3387      if stelle > 1 then put char 1 to (stelle - 1) of srcText & replText after newtext 
     3388      else put replText after newtext 
     3389       
     3390      delete char 1 to (stelle + len - 1) of srcText 
     3391       
     3392      stelle = offset(fromChunk, srcText) 
     3393       
     3394      if stelle = 0 then put srcText after newtext 
     3395       
     3396    end repeat 
     3397     
     3398  else -- no match 
     3399     
     3400    return srcText 
     3401  end if 
     3402   
     3403  return newtext 
     3404end 
     3405 
     3406 
    33323407 
    33333408-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     
    34823557    end if 
    34833558     
    3484      
    3485      
    3486   end if 
    3487    
    3488    
     3559  end if 
    34893560   
    34903561  cl = the activecastlib 
     
    37833854  if ilk(workingCopies) <> #proplist then workingCopies = [:] 
    37843855   
    3785    
    37863856  svnBinary = mGetSVNBinaryPath(me, workingCopies) 
    37873857  if length(svnBinary) < 1 then exit 
     
    38023872    if answer = "Always save" then workingCopies.setaprop(#dontWarnWhenSaving, 1) 
    38033873  end if 
     3874   
     3875   
    38043876  saveMovie() 
    38053877   
     3878   
    38063879  mExportAllScriptsToDiskWithFolder me, 1, selected_Members_Only, 1, workingFolder 
    3807    
    38083880   
    38093881   
     
    38133885  end if 
    38143886   
     3887   
     3888  theresult = shell_cmd_list(svnBinary && "update" && QUOTE & workingFolder & QUOTE) 
     3889   
     3890  if count(theresult) < 1 then 
     3891    theresult = shell_cmd_list(svnBinary && "update" && QUOTE & workingFolder & QUOTE && "2>&1") 
     3892    if count(theresult) < 1 then 
     3893      theError = theresult[1] 
     3894    else 
     3895      theError = "svn did not respond at all." 
     3896    end if 
     3897    alert "Can't proceed svn error while trying to update:" && theError 
     3898    exit   
     3899  end if 
     3900   
    38153901  theresult = shell_cmd_list(svnBinary && "status" && QUOTE & workingFolder & QUOTE) 
    38163902   
    38173903  cnt = count(theresult) 
    38183904  if cnt < 1 then 
    3819     alert "Apparently there are no changes to the most recent version in the svn repository" 
     3905    alert "Apparently there are no changes to the most recent version in the svn repository: svn status is empty" 
    38203906    exit 
    38213907  end if 
     
    38513937   
    38523938  if count(theresult) > 0 then 
    3853     alert "svn response:" && theresult[1] 
     3939    theResult = theresult[1] 
     3940     
     3941    put theResult 
     3942    alert "svn response:" && theresult 
     3943     
    38543944  else 
    38553945    alert "svn application did not respond, something seems to have failed. :-(" 
  • trunk/lingosource/castlib2/memberInfo.xml

    r2 r6  
    6161                <memberName>commonMovieScript</memberName> 
    6262        </commonmoviescript> 
     63        <commonmoviescript> 
     64                <scriptType>#parent</scriptType> 
     65                <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 
     66                <memberName>commonMovieScript</memberName> 
     67        </commonmoviescript> 
    6368        <commonMovieScript> 
    6469                <scriptType>#parent</scriptType> 
Note: See TracChangeset for help on using the changeset viewer.