SF.net SVN: fclient: [392] trunk/sandbox/fcp2/message.py
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-04-09 21:09:54
|
Revision: 392
http://fclient.svn.sourceforge.net/fclient/?rev=392&view=rev
Author: jUrner
Date: 2008-04-09 14:09:58 -0700 (Wed, 09 Apr 2008)
Log Message:
-----------
add node tree to deal with hirarchical message params
Modified Paths:
--------------
trunk/sandbox/fcp2/message.py
Modified: trunk/sandbox/fcp2/message.py
===================================================================
--- trunk/sandbox/fcp2/message.py 2008-04-09 21:09:48 UTC (rev 391)
+++ trunk/sandbox/fcp2/message.py 2008-04-09 21:09:58 UTC (rev 392)
@@ -17,6 +17,7 @@
from fcp2 import consts
from fcp2 import types
from fcp2.fcp_lib import pmstruct
+from fcp2.fcp_lib import node
from fcp2.fcp_lib import uuid
@@ -25,6 +26,13 @@
#********************************************************************************
#
#********************************************************************************
+class Node(node.Node):
+ """Node tree used along with messages"""
+ ComponentSep = '.'
+
+#********************************************************************************
+#
+#********************************************************************************
class PrivateParam(str):
"""Helper class to mark a message parameter as PrivateParam to the package"""
@@ -146,6 +154,18 @@
return '\n'.join(out)
+ def toTree(self):
+ """Converts message params to a tree of nodes
+ @return: (L{Node}) root node
+
+ @note: some messages have hirarchicaly organized (dotted) parameters. Use this
+ method to convert the parameters to a tree of nodes
+ """
+ node_ = Node()
+ for name, value in self.params.iteritems():
+ node_[name] = value
+
+
def updatePersistentParams(self):
pass
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|