SF.net SVN: fclient: [91] trunk/sandbox/fcp/fcp2_0_consts.py
Status: Pre-Alpha
Brought to you by:
jurner
From: <ju...@us...> - 2008-01-30 14:35:28
|
Revision: 91 http://fclient.svn.sourceforge.net/fclient/?rev=91&view=rev Author: jurner Date: 2008-01-30 06:35:33 -0800 (Wed, 30 Jan 2008) Log Message: ----------- fixes Modified Paths: -------------- trunk/sandbox/fcp/fcp2_0_consts.py Modified: trunk/sandbox/fcp/fcp2_0_consts.py =================================================================== --- trunk/sandbox/fcp/fcp2_0_consts.py 2008-01-30 13:23:25 UTC (rev 90) +++ trunk/sandbox/fcp/fcp2_0_consts.py 2008-01-30 14:35:33 UTC (rev 91) @@ -574,7 +574,7 @@ 'logger.enabled': FcpTypeBool, 'logger.interval': FcpType, # ??? 1HOUR ?? 'logger.maxCachedBytes': FcpTypeNumBytes, - 'logger.maxCachedLines': FcpTypeIntWithBounds(0, None), # ??? + 'logger.maxCachedLines': FcpTypeNumBytes, # ??? 'logger.maxZippedLogsSize': FcpTypeNumBytes, # ??? 'logger.priority': FcpTypeChoiceLoggerPriority, 'logger.priorityDetail': FcpType, # ???? is it Detailed priority thresholds ??? @@ -661,30 +661,42 @@ } + def __init__(self): + pass + + def splitAll(self, paramName): return paramName.split(self.ComponentsSep) def splitParamClass(self, paramName): return paramName.split(self.ComponentsSep, 1) + + def get(self, paramName, default=None): + try: + return self[paramName] + except KeyError: + return default + + def __getitem__(self, paramName): paramClass, paramKey = self.splitParamClass(paramName) if paramClass == self.ParamClassCurrent: - return self.Params[paramName] + return self.Params[paramKey] elif paramClass == self.ParamClassDefault: - return self.Params[paramName] - elif paramClass == ParamClassExpertFlag: + return self.Params[paramKey] + elif paramClass == self.ParamClassExpertFlag: return FcpTypeBool - elif paramClass == ParamClassForceWriteFlag: + elif paramClass == self.ParamClassForceWriteFlag: return FcpTypeBool - elif paramClass == ParamClassShortDescription: + elif paramClass == self.ParamClassShortDescription: return FcpTypeString - elif paramClass == ParamClassLongDescription: + elif paramClass == self.ParamClassLongDescription: return FcpTypeString - elif paramClass == ParamClassSortOrder: + elif paramClass == self.ParamClassSortOrder: return FcpTypeInt else: - raise ValueError('Unkinown param class in: %r' % paramName) + raise ValueError('Unknown param class in: %r' % paramName) #*************************************************************************************** # This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |