From: <ror...@us...> - 2007-07-27 18:27:44
|
Revision: 136 http://roreditor.svn.sourceforge.net/roreditor/?rev=136&view=rev Author: rorthomas Date: 2007-07-27 11:27:37 -0700 (Fri, 27 Jul 2007) Log Message: ----------- * removed all .bat files (too much troubles with it...) * fixed some bugs * improved setup Modified Paths: -------------- trunk/devtools/rorrepo.reg trunk/devtools/setup/setup.nsi trunk/lib/ror/starter.py trunk/lib/ror/svngui.py Removed Paths: ------------- trunk/tools/checkmods.bat trunk/tools/depchecker.bat trunk/tools/modtool.bat trunk/tools/postinstall.bat trunk/tools/postinstall.py trunk/tools/update.bat trunk/tools/updaterestart.bat Modified: trunk/devtools/rorrepo.reg =================================================================== --- trunk/devtools/rorrepo.reg 2007-07-27 13:11:52 UTC (rev 135) +++ trunk/devtools/rorrepo.reg 2007-07-27 18:27:37 UTC (rev 136) @@ -9,4 +9,4 @@ [HKEY_CLASSES_ROOT\RoRRepo\shell\open] [HKEY_CLASSES_ROOT\RoRRepo\shell\open\command] -@="\"D:\\projects\\sfproject\\svn\\trunk\\modtool.bat\" \"installrepo\" \"%1\"" \ No newline at end of file +@="\"c:\\roryoolkit\\tools\\modtool.py\" \"installrepo\" \"%1\"" \ No newline at end of file Modified: trunk/devtools/setup/setup.nsi =================================================================== --- trunk/devtools/setup/setup.nsi 2007-07-27 13:11:52 UTC (rev 135) +++ trunk/devtools/setup/setup.nsi 2007-07-27 18:27:37 UTC (rev 136) @@ -42,6 +42,8 @@ !insertmacro MUI_PAGE_WELCOME ; License page !insertmacro MUI_PAGE_LICENSE "readme-installer.txt" +; Components page +!insertmacro MUI_PAGE_COMPONENTS ; Directory page !insertmacro MUI_PAGE_DIRECTORY ; Instfiles page @@ -85,6 +87,7 @@ ShowInstDetails show ShowUnInstDetails show + Var /GLOBAL PYOK Var /GLOBAL PYPATH Var /GLOBAL PYINSTALLED @@ -186,18 +189,18 @@ FunctionEnd Function InstallRoRRepoReg - InitPluginsDir - File /oname=$PLUGINSDIR\graphviz-2.12.exe "..\rorrepo.reg" - Banner::show /NOUNLOAD "Installing RoR Repository Protocol Extensions ..." - ExecWait '"regedit /s $PLUGINSDIR\rorrepo.reg"' - Delete $PLUGINSDIR\rorrepo.reg - Banner::destroy + Banner::show /NOUNLOAD "Updating RoR Repository Protocol Extensions ..." + WriteRegStr HKCR "RoRRepo" "" "URL:RoRRepo Protocol" + WriteRegStr HKCR "RoRRepo" "URL Protocol" "" + WriteRegStr HKCR "RoRRepo\shell" "" "" + WriteRegStr HKCR "RoRRepo\shell\open" "" "" + WriteRegStr HKCR "RoRRepo\shell\open\command" "" "'$INSTPATH' 'installrepo' '%1'" + Banner::destroy FunctionEnd - Function .onInit InitPluginsDir - File /oname=$PLUGINSDIR\..bmp "splash.bmp" + File /oname=$PLUGINSDIR\splash.bmp "splash.bmp" advsplash::show 1000 1300 600 -1 $PLUGINSDIR\splash Pop $0 Delete $PLUGINSDIR\splash.bmp @@ -213,13 +216,13 @@ Call InstallPyWin32 Call InstallPyParsing Call InstallGraphViz - Call InstallRoRRepoReg + Call ChangeRoRRepoReg SectionEnd Section "Full Installation" SEC03 SetOutPath "$INSTDIR" SetOverwrite try - File "/r" "..\..\*" + File /r /x *.pyc /x .svn /x ..\..\tools\3rdparty /x ..\devtools ..\..\* SectionEnd Function "LaunchPostInstallation" @@ -269,4 +272,148 @@ DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" SetAutoClose false -SectionEnd \ No newline at end of file +SectionEnd + +# tools following: +Function AdvReplaceInFile +Exch $0 ;file to replace in +Exch +Exch $1 ;number to replace after +Exch +Exch 2 +Exch $2 ;replace and onwards +Exch 2 +Exch 3 +Exch $3 ;replace with +Exch 3 +Exch 4 +Exch $4 ;to replace +Exch 4 +Push $5 ;minus count +Push $6 ;universal +Push $7 ;end string +Push $8 ;left string +Push $9 ;right string +Push $R0 ;file1 +Push $R1 ;file2 +Push $R2 ;read +Push $R3 ;universal +Push $R4 ;count (onwards) +Push $R5 ;count (after) +Push $R6 ;temp file name + + GetTempFileName $R6 + FileOpen $R1 $0 r ;file to search in + FileOpen $R0 $R6 w ;temp file + StrLen $R3 $4 + StrCpy $R4 -1 + StrCpy $R5 -1 + +loop_read: + ClearErrors + FileRead $R1 $R2 ;read line + IfErrors exit + + StrCpy $5 0 + StrCpy $7 $R2 + +loop_filter: + IntOp $5 $5 - 1 + StrCpy $6 $7 $R3 $5 ;search + StrCmp $6 "" file_write2 + StrCmp $6 $4 0 loop_filter + +StrCpy $8 $7 $5 ;left part +IntOp $6 $5 + $R3 +IntCmp $6 0 is0 not0 +is0: +StrCpy $9 "" +Goto done +not0: +StrCpy $9 $7 "" $6 ;right part +done: +StrCpy $7 $8$3$9 ;re-join + +IntOp $R4 $R4 + 1 +StrCmp $2 all file_write1 +StrCmp $R4 $2 0 file_write2 +IntOp $R4 $R4 - 1 + +IntOp $R5 $R5 + 1 +StrCmp $1 all file_write1 +StrCmp $R5 $1 0 file_write1 +IntOp $R5 $R5 - 1 +Goto file_write2 + +file_write1: + FileWrite $R0 $7 ;write modified line +Goto loop_read + +file_write2: + FileWrite $R0 $R2 ;write unmodified line +Goto loop_read + +exit: + FileClose $R0 + FileClose $R1 + + SetDetailsPrint none + Delete $0 + Rename $R6 $0 + Delete $R6 + SetDetailsPrint both + +Pop $R6 +Pop $R5 +Pop $R4 +Pop $R3 +Pop $R2 +Pop $R1 +Pop $R0 +Pop $9 +Pop $8 +Pop $7 +Pop $6 +Pop $5 +Pop $0 +Pop $1 +Pop $2 +Pop $3 +Pop $4 +FunctionEnd + + +Function StrRep + Exch $R4 ; $R4 = Replacement String + Exch + Exch $R3 ; $R3 = String to replace (needle) + Exch 2 + Exch $R1 ; $R1 = String to do replacement in (haystack) + Push $R2 ; Replaced haystack + Push $R5 ; Len (needle) + Push $R6 ; len (haystack) + Push $R7 ; Scratch reg + StrCpy $R2 "" + StrLen $R5 $R3 + StrLen $R6 $R1 +loop: + StrCpy $R7 $R1 $R5 + StrCmp $R7 $R3 found + StrCpy $R7 $R1 1 ; - optimization can be removed if U know len needle=1 + StrCpy $R2 "$R2$R7" + StrCpy $R1 $R1 $R6 1 + StrCmp $R1 "" done loop +found: + StrCpy $R2 "$R2$R4" + StrCpy $R1 $R1 $R6 $R5 + StrCmp $R1 "" done loop +done: + StrCpy $R3 $R2 + Pop $R7 + Pop $R6 + Pop $R5 + Pop $R2 + Pop $R1 + Pop $R4 + Exch $R3 +FunctionEnd \ No newline at end of file Modified: trunk/lib/ror/starter.py =================================================================== --- trunk/lib/ror/starter.py 2007-07-27 13:11:52 UTC (rev 135) +++ trunk/lib/ror/starter.py 2007-07-27 18:27:37 UTC (rev 136) @@ -127,7 +127,7 @@ def OnDepGraph(self, event=None): import ror.depchecker ror.depchecker.RoRDepChecker(self.rordir, "all", "") - file = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..\\..\\graphs\\alldependencies.png")) + file = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "graphs", "alldependencies.png")) #print file if os.path.isfile(file): dlg = wx.MessageDialog(self, "Graph successfully created:\n"+file, "Info", wx.OK | wx.ICON_INFORMATION) @@ -135,6 +135,10 @@ dlg.Destroy() cmd = file p = subprocess.Popen(cmd, shell = True, stderr = subprocess.PIPE, stdout = subprocess.PIPE) + else: + dlg = wx.MessageDialog(self, "Graph creation failed :(", "Info", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() def OnUpdate(self, event=None): Modified: trunk/lib/ror/svngui.py =================================================================== --- trunk/lib/ror/svngui.py 2007-07-27 13:11:52 UTC (rev 135) +++ trunk/lib/ror/svngui.py 2007-07-27 18:27:37 UTC (rev 136) @@ -23,8 +23,7 @@ del self.pr def restart(self): - path = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)),"..\\..")) - path = os.path.join(path, "updaterestart.bat") + path = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "tools", "updaterestart.py")) log().info("restarting ...") p = Popen(path, shell = True) sys.exit(0) Deleted: trunk/tools/checkmods.bat =================================================================== --- trunk/tools/checkmods.bat 2007-07-27 13:11:52 UTC (rev 135) +++ trunk/tools/checkmods.bat 2007-07-27 18:27:37 UTC (rev 136) @@ -1,2 +0,0 @@ -...@po...t checkmods -@%systemdrive%\python25\python.exe checkmods.py %* \ No newline at end of file Deleted: trunk/tools/depchecker.bat =================================================================== --- trunk/tools/depchecker.bat 2007-07-27 13:11:52 UTC (rev 135) +++ trunk/tools/depchecker.bat 2007-07-27 18:27:37 UTC (rev 136) @@ -1,2 +0,0 @@ -...@po...t depchecker -@%systemdrive%\python25\python.exe depchecker.py %* \ No newline at end of file Deleted: trunk/tools/modtool.bat =================================================================== --- trunk/tools/modtool.bat 2007-07-27 13:11:52 UTC (rev 135) +++ trunk/tools/modtool.bat 2007-07-27 18:27:37 UTC (rev 136) @@ -1,2 +0,0 @@ -...@po...t modtool -@%systemdrive%\python25\python.exe modtool.py %* \ No newline at end of file Deleted: trunk/tools/postinstall.bat =================================================================== --- trunk/tools/postinstall.bat 2007-07-27 13:11:52 UTC (rev 135) +++ trunk/tools/postinstall.bat 2007-07-27 18:27:37 UTC (rev 136) @@ -1 +0,0 @@ -@%systemdrive%\python25\python.exe postinstall.py %* \ No newline at end of file Deleted: trunk/tools/postinstall.py =================================================================== --- trunk/tools/postinstall.py 2007-07-27 13:11:52 UTC (rev 135) +++ trunk/tools/postinstall.py 2007-07-27 18:27:37 UTC (rev 136) @@ -1,40 +0,0 @@ -import sys, os, os.path, subprocess - -def getBATFiles(): - batfiles = [] - dir = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)))) - for filename in os.listdir(dir): - filenameonly, extension = os.path.splitext(filename) - if extension.lower() == ".bat": - batfiles.append(os.path.join(dir, filename)) - return batfiles - -def saveFile(filename, lines): - f = open(filename, 'w') - f.writelines(lines) - f.close() - -def addPath(filename, installpath): - basename = os.path.basename(filename) - filenameonly, extension = os.path.splitext(basename) - - # with console - thispath = os.path.join(installpath, filenameonly+".py") - pythonpath = "%systemdrive%\python25\python.exe" - if not os.path.isfile(thispath): - # without console - thispath = os.path.join(installpath, filenameonly+".pyw") - pythonpath = "%systemdrive%\python25\pythonw.exe" - content = ["@%s %s %%*" % (pythonpath, thispath)] - saveFile(filename, content) - -def main(): - installpath = os.path.dirname(os.path.abspath(__file__)) - for batfile in getBATFiles(): - addPath(batfile, installpath) - print "Post-Installed all .bat files, please restart the program now!" - cmd = os.path.join(installpath, sys.argv[1]+".bat") - subprocess.Popen(cmd, shell = True) - -if __name__=="__main__": - main() Deleted: trunk/tools/update.bat =================================================================== --- trunk/tools/update.bat 2007-07-27 13:11:52 UTC (rev 135) +++ trunk/tools/update.bat 2007-07-27 18:27:37 UTC (rev 136) @@ -1,2 +0,0 @@ -...@po...t update -@%systemdrive%\python25\python.exe update.py %* \ No newline at end of file Deleted: trunk/tools/updaterestart.bat =================================================================== --- trunk/tools/updaterestart.bat 2007-07-27 13:11:52 UTC (rev 135) +++ trunk/tools/updaterestart.bat 2007-07-27 18:27:37 UTC (rev 136) @@ -1,2 +0,0 @@ -...@po...t updaterestart -@%systemdrive%\python25\python.exe updaterestart.py %* \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |