From: <Z3...@us...> - 2012-06-07 20:46:36
|
Revision: 339 http://spd.svn.sourceforge.net/spd/?rev=339&view=rev Author: Z3po Date: 2012-06-07 20:46:30 +0000 (Thu, 07 Jun 2012) Log Message: ----------- I just quick-fixed the work-in-progress. I need to continue with spd-ng once i get the time *being ashamed* Modified Paths: -------------- branches/spd-ng/src/spdConfig.py Modified: branches/spd-ng/src/spdConfig.py =================================================================== --- branches/spd-ng/src/spdConfig.py 2011-06-28 21:24:35 UTC (rev 338) +++ branches/spd-ng/src/spdConfig.py 2012-06-07 20:46:30 UTC (rev 339) @@ -10,7 +10,6 @@ '''This is the Configuration Module You can read or set config options''' __configfile = None - ConfigSection = 'Main' ReturnCodes = { 2 : 'Missing ConfigFile', 4 : 'ConfigFile not Readable', @@ -18,6 +17,7 @@ 16 : 'Configfile Writeable but another Error Occured', 32 : 'Section not found', 64 : 'Option not found' } + ConfigSection = 'Main' def __init__(self, configfile='~/.spd/config'): # {{{ self.__configfile = os.path.expanduser(configfile) @@ -203,7 +203,17 @@ return reval return 0 + # }}} + def getAllSections(self): # {{{ + reval, config = self.__checkConfigFileReadable() + if reval > 0: + return reval, config + + if config.sections(): + return 0, config.sections() + + return 32, config # }}} def getSections(self, raw=False): # {{{ @@ -226,7 +236,6 @@ if reval > 0: self.__ErrorHandler(self.ReturnCodes[reval]) - # }}} def getConfigVersion(self, raw=False): # {{{ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |