SF.net SVN: fclient: [106] trunk/sandbox/fcp/fcp2_0_config.py
Status: Pre-Alpha
Brought to you by:
jurner
From: <ju...@us...> - 2008-02-02 05:13:18
|
Revision: 106 http://fclient.svn.sourceforge.net/fclient/?rev=106&view=rev Author: jurner Date: 2008-02-01 21:13:24 -0800 (Fri, 01 Feb 2008) Log Message: ----------- adapt to recent Modified Paths: -------------- trunk/sandbox/fcp/fcp2_0_config.py Modified: trunk/sandbox/fcp/fcp2_0_config.py =================================================================== --- trunk/sandbox/fcp/fcp2_0_config.py 2008-02-02 05:12:51 UTC (rev 105) +++ trunk/sandbox/fcp/fcp2_0_config.py 2008-02-02 05:13:24 UTC (rev 106) @@ -1,23 +1,24 @@ """Sketch for fcp config tree""" -from fcp2_0_consts import ConfigMessageParams +import fcp2_0_types as types #**************************************************************************************** # #**************************************************************************************** class ConfigItem(object): - """Config item""" + """Config item + @ivar parent: parent item + @ivar name: name of the item + @ivar children: (dict) child items + @ivar values: dict of values + """ + def __init__(self, parent, name): """ @param parent: parent item @param name: name of the item - - @ivar parent: parent item - @ivar name: name of the item - @ivar children: (dict) child items - @ivar values: dict of values """ self.parent = parent self.name = name @@ -35,7 +36,7 @@ out.append(parent.name) parent = parent.parent out.reverse() - return ConfigMessageParams.ComponentsSep.join(out) + return types-ConfigMessageParams.ComponentsSep.join(out) #**************************************************************************************** @@ -43,30 +44,29 @@ #**************************************************************************************** class Config(object): """Class representing fcp config tree + + @ivar parent: parent item + @ivar name: name of the config (always None) + @ivar children: (dict) child items """ - ValueClassCurrent = ConfigMessageParams.ParamClassCurrent - ValueClassDefault = ConfigMessageParams.ParamClassDefault - ValueClassExpertFlag = ConfigMessageParams.ParamClassExpertFlag - ValueClassForceWriteFlag = ConfigMessageParams.ParamClassForceWriteFlag - ValueClassShortDescription = ConfigMessageParams.ParamClassShortDescription - ValueClassLongDescription = ConfigMessageParams.ParamClassLongDescription + ValueClassCurrent = types.ConfigMessageParams.ParamClassCurrent + ValueClassDefault = types.ConfigMessageParams.ParamClassDefault + ValueClassExpertFlag = types.ConfigMessageParams.ParamClassExpertFlag + ValueClassForceWriteFlag = types.ConfigMessageParams.ParamClassForceWriteFlag + ValueClassShortDescription = types.ConfigMessageParams.ParamClassShortDescription + ValueClassLongDescription = types.ConfigMessageParams.ParamClassLongDescription def __init__(self, configDataMsg=None): """ - @param parent: parent item - @param name: name of the item - - @ivar parent: parent item - @ivar name: name of the item - @ivar children: (dict) child items + @param configDataMsg: ConfigData message to initialize the config with or None """ self.parent = None self.name = None self.children = {} - self._configMessageParams = ConfigMessageParams() + self._configMessageParams = types.ConfigMessageParams() if configDataMsg is not None: for key, value in configDataMsg.params.items(): @@ -143,7 +143,7 @@ def walk(self): - """Walks over the config tree, returning the next L{ConfigItemm} in turn""" + """Walks over the config tree, returning the next L{ConfigItem} in turn""" def walker(node): yield node for child in node.children.values(): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |