From: <Z3...@us...> - 2010-11-29 09:38:38
|
Revision: 320 http://spd.svn.sourceforge.net/spd/?rev=320&view=rev Author: Z3po Date: 2010-11-29 09:38:31 +0000 (Mon, 29 Nov 2010) Log Message: ----------- cleanup Modified Paths: -------------- branches/spd-ng/src/spdCheck.py branches/spd-ng/src/spdInterface.py Modified: branches/spd-ng/src/spdCheck.py =================================================================== --- branches/spd-ng/src/spdCheck.py 2010-11-28 12:16:35 UTC (rev 319) +++ branches/spd-ng/src/spdCheck.py 2010-11-29 09:38:31 UTC (rev 320) @@ -14,10 +14,7 @@ """Do the initial checks. # module: which module called me??""" - if module == "spdInterface": - self.__checkSPDdir() - elif module == "spdCore": - pass + self.module = 'spdInterface' # }}} def __ErrorHandler(self, message): # {{{ @@ -30,35 +27,35 @@ sys.exit(2) # }}} - def __checkSPDdir(self): # {{{ - """Check if the spd directory exists""" + def startupCheck(self): # {{{ + """Do initial checks""" - if not os.access(self.spddir, os.F_OK): - os.mkdir(spddir) - # }}} + if self.module == 'spdInterface': - def checkConfigFile(self): # {{{ - """Check the configfile.""" + if not os.access(self.spddir, os.F_OK): + os.mkdir(spddir) - config = self.config + config = self.config - reval, version = config.getConfigVersion(raw=True) + reval, version = config.getConfigVersion(raw=True) - if reval > 0 and reval < 64: - Defaults.createDefaultConfig(config) - elif reval == 64: - print 'ConfigVersion not found...setting Default one\n' - config.setConfigVersion('0.3-alpha') - version = config.getConfigVersion() + if reval > 0 and reval < 64: + Defaults.createDefaultConfig(config) + elif reval == 64: + print 'ConfigVersion not found...setting Default one\n' + config.setConfigVersion('0.3-alpha') + version = config.getConfigVersion() - reval, clientmode = config.getClientmode(raw=True) - - if reval > 0: - config.setClientmode('CLI') - clientmode = config.getClientmode() + reval, clientmode = config.getClientmode(raw=True) + + if reval > 0: + config.setClientmode('CLI') + clientmode = config.getClientmode() - return({ 'version' : version, + return({ 'version' : version, 'clientmode' : clientmode }) + else: + return True # }}} Modified: branches/spd-ng/src/spdInterface.py =================================================================== --- branches/spd-ng/src/spdInterface.py 2010-11-28 12:16:35 UTC (rev 319) +++ branches/spd-ng/src/spdInterface.py 2010-11-29 09:38:31 UTC (rev 320) @@ -16,7 +16,7 @@ """init procedure""" check = spdCheck.Check("spdInterface") - initcheck = check.checkConfigFile() + initcheck = check.startupCheck() self.version = initcheck['version'] if not clientmode: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |