Changeset 6 for trunk/lingosource
- Timestamp:
- 08/30/07 14:36:26 (5 years ago)
- Location:
- trunk/lingosource
- Files:
-
- 2 edited
-
castlib1/alexUtilities.ls (modified) (8 diffs)
-
castlib2/memberInfo.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lingosource/castlib1/alexUtilities.ls
r2 r6 3275 3275 ----------------------------------------- 3276 3276 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") 3291 3282 end if 3292 3293 thumbmember.erase() 3294 3283 else 3284 alterText = mGetTextFromFile(me, thisFolder & theDefaultName & ".ls") 3295 3285 end if 3296 3286 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 3309 3334 end if 3310 3311 3335 end if 3312 3336 … … 3314 3338 infolist.setaprop(origname, [#scripttype: memref.scripttype, #comments: memref.comments, #membername: memname]) 3315 3339 3316 if origname <> memname then3317 put "Renamed member" && memref && "to" && origname & ". Scriptmember names must not be emoty or contain illegal characters (SPACE, /, :, \, &)"3318 end if3319 3320 3340 end if 3341 3321 3342 3322 3343 end repeat … … 3327 3348 end repeat 3328 3349 3329 3330 3331 end 3350 end 3351 3352 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 3353 3354 on 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 3371 end 3372 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 3373 3374 -- using offset() -> no pregex 3375 on 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 3404 end 3405 3406 3332 3407 3333 3408 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx … … 3482 3557 end if 3483 3558 3484 3485 3486 end if 3487 3488 3559 end if 3489 3560 3490 3561 cl = the activecastlib … … 3783 3854 if ilk(workingCopies) <> #proplist then workingCopies = [:] 3784 3855 3785 3786 3856 svnBinary = mGetSVNBinaryPath(me, workingCopies) 3787 3857 if length(svnBinary) < 1 then exit … … 3802 3872 if answer = "Always save" then workingCopies.setaprop(#dontWarnWhenSaving, 1) 3803 3873 end if 3874 3875 3804 3876 saveMovie() 3805 3877 3878 3806 3879 mExportAllScriptsToDiskWithFolder me, 1, selected_Members_Only, 1, workingFolder 3807 3808 3880 3809 3881 … … 3813 3885 end if 3814 3886 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 3815 3901 theresult = shell_cmd_list(svnBinary && "status" && QUOTE & workingFolder & QUOTE) 3816 3902 3817 3903 cnt = count(theresult) 3818 3904 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" 3820 3906 exit 3821 3907 end if … … 3851 3937 3852 3938 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 3854 3944 else 3855 3945 alert "svn application did not respond, something seems to have failed. :-(" -
trunk/lingosource/castlib2/memberInfo.xml
r2 r6 61 61 <memberName>commonMovieScript</memberName> 62 62 </commonmoviescript> 63 <commonmoviescript> 64 <scriptType>#parent</scriptType> 65 <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 66 <memberName>commonMovieScript</memberName> 67 </commonmoviescript> 63 68 <commonMovieScript> 64 69 <scriptType>#parent</scriptType>
Note: See TracChangeset
for help on using the changeset viewer.
