SF.net SVN: fclient: [338] trunk/sandbox/fcp2/iohandler.py
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-03-08 11:11:53
|
Revision: 338
http://fclient.svn.sourceforge.net/fclient/?rev=338&view=rev
Author: jUrner
Date: 2008-03-08 03:11:57 -0800 (Sat, 08 Mar 2008)
Log Message:
-----------
adapt to new message handling
Modified Paths:
--------------
trunk/sandbox/fcp2/iohandler.py
Modified: trunk/sandbox/fcp2/iohandler.py
===================================================================
--- trunk/sandbox/fcp2/iohandler.py 2008-03-08 11:10:20 UTC (rev 337)
+++ trunk/sandbox/fcp2/iohandler.py 2008-03-08 11:11:57 UTC (rev 338)
@@ -181,13 +181,13 @@
"""
@paran ioPrototype: (L{IOObjectBase}) derrived class to handle message io
"""
-
self._ioPrototype = ioPrototype
self._log = logging.getLogger(consts.LoggerNames.IOHandler)
self._receiveBuffer = ''
- self.io = None
-
+ self.io = None
+
+
def connect(self, duration=20, timeout=0.5, **kwargs):
"""Connect to the io device
@@ -313,9 +313,13 @@
if not p:
raise MessageParseError('Missing message name')
msgName = p.pop(0)
- msg = message.Message(msgName)
- paramTypes = types.MessageParamTypes.get(msgName, None)
-
+ msgClass = message.MessagesAll.get(msgName, None)
+ # TODO: log?
+ if msgClass is None:
+ self._log.debug(consts.LogMessages.CreatingNewMessageType + ' "%s"' % msgClassname)
+ msgClass = message.newMessageType(msgName)
+ msg = msgClass()
+
# process param --> value fields
#
#NOTE:usually if data is passed DataLength determines how much have to handle
@@ -327,12 +331,13 @@
paramName, sep, paramValue = line.partition('=')
# covert fcp to python value if necessary
- if paramTypes is not None:
- paramType = paramTypes.get(paramName, None)
- if paramType is not None:
- paramValue = paramType.fcpToPython(paramValue)
+ paramType = msg._param_types_.get(paramName, None)
+ if paramType is not None:
+ paramValue = paramType.fcpToPython(paramValue)
msg[paramName] = paramValue
+ #TODO: move to message.ClientPutComplexDir
+
# handle special case PutComplexDir
if isClientPutComplexDir:
tmp_paramName = paramName.split('.')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|