From: <ror...@us...> - 2007-07-01 13:07:28
|
Revision: 71 http://roreditor.svn.sourceforge.net/roreditor/?rev=71&view=rev Author: rorthomas Date: 2007-07-01 06:07:27 -0700 (Sun, 01 Jul 2007) Log Message: ----------- * moved editor.ini file to main directory * svn update now creates a backup the file ogre.cfg and restores it after the update * please do NOT check in editor.ini in future revisions. it is generated upon the first start Modified Paths: -------------- trunk/lib/ror/settingsManager.py trunk/lib/ror/svn.py Removed Paths: ------------- trunk/lib/ror/editor.ini Deleted: trunk/lib/ror/editor.ini =================================================================== --- trunk/lib/ror/editor.ini 2007-06-30 19:27:23 UTC (rev 70) +++ trunk/lib/ror/editor.ini 2007-07-01 13:07:27 UTC (rev 71) @@ -1,6 +0,0 @@ -[RigsOfRods] -basepath = C:\games\RoR-0.31a - -[gui] -usegui = yes - Modified: trunk/lib/ror/settingsManager.py =================================================================== --- trunk/lib/ror/settingsManager.py 2007-06-30 19:27:23 UTC (rev 70) +++ trunk/lib/ror/settingsManager.py 2007-07-01 13:07:27 UTC (rev 71) @@ -13,7 +13,8 @@ class RoRSettings: myConfig = None - configfilename = os.path.join(os.path.dirname(os.path.abspath(__file__)), CONFIGFILE) + configfilename = os.path.join(os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)),"..\\..")),CONFIGFILE) + #configfilename = os.path.join(os.path.dirname(os.path.abspath(__file__)), CONFIGFILE) def __init__(self): self.loadSettings() Modified: trunk/lib/ror/svn.py =================================================================== --- trunk/lib/ror/svn.py 2007-06-30 19:27:23 UTC (rev 70) +++ trunk/lib/ror/svn.py 2007-07-01 13:07:27 UTC (rev 71) @@ -4,6 +4,7 @@ URL = "http://roreditor.svn.sourceforge.net/svnroot/roreditor/trunk" changes = 0 +BACKUPFILES = ['ogre.cfg'] def getRootPath(): path = os.path.dirname(os.path.abspath(__file__)) @@ -87,10 +88,27 @@ except: print "error while checkout!" +def createBackup(): + import shutil + for f in BACKUPFILES: + fn = os.path.join(getRootPath(), f) + fnbackup = fn + "_backup" + if os.path.isfile(fn): + shutil.copy(fn, fnbackup) +def restoreBackup(): + import shutil + for f in BACKUPFILES: + fn = os.path.join(getRootPath(), f) + fnbackup = fn + "_backup" + if os.path.isfile(fnbackup): + shutil.move(fnbackup, fn) + def run(): if os.path.isdir(os.path.join(getRootPath(), "media")): + createBackup() svnupdate() + restoreBackup() else: svncheckout() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |