SF.net SVN: fclient: [364] trunk/sandbox/fcp2/client.py
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-03-11 11:19:10
|
Revision: 364
http://fclient.svn.sourceforge.net/fclient/?rev=364&view=rev
Author: jUrner
Date: 2008-03-11 04:19:16 -0700 (Tue, 11 Mar 2008)
Log Message:
-----------
key objects are is now accepted on get
Modified Paths:
--------------
trunk/sandbox/fcp2/client.py
Modified: trunk/sandbox/fcp2/client.py
===================================================================
--- trunk/sandbox/fcp2/client.py 2008-03-11 01:04:40 UTC (rev 363)
+++ trunk/sandbox/fcp2/client.py 2008-03-11 11:19:16 UTC (rev 364)
@@ -602,7 +602,7 @@
@return: True if the message was handled, False otherwise
"""
- CancelPersistentRequests = 1 # for testing... if True, cancels all PersistentRequests
+ CancelPersistentRequests = 0 # for testing... if True, cancels all PersistentRequests
# check if we have an initial request corrosponding to msg
requestIdentifier = msg.get('Identifier', None)
@@ -898,7 +898,8 @@
self._requests[initialRequest['Identifier']] = initialRequest
#FIX: remove Started param from PersistentGet / Put
- del initialRequest.params['Started']
+ if 'Started' in initialRequest.params:
+ del initialRequest.params['Started']
#FIX: [0001965: Persistence vs PersistenceType]
if 'PersistenceType' in initialRequest.params:
initialRequest['Persistence'] = initialRequest.params.pop('PersistenceType')
@@ -1105,7 +1106,9 @@
elif msg == message.SubscribedUSKUpdate:
if initialRequest is None:
return False
- self.events.USKUpdated(msg)
+
+ initialRequest['Edition'] =msg['Edition']
+ self.events.USKUpdated(initialRequest)
return True
@@ -1269,6 +1272,9 @@
@return: (str) identifier of the request
"""
+ if hasattr(key, 'toString'):
+ key = key.toString()
+
msg = message.ClientGet(URI=key)
for paramName, value in messageParams.items():
if value is not None:
@@ -1285,7 +1291,7 @@
return msg['Identifier']
-
+ #TESTED
def getData(self,
key,
@@ -1351,6 +1357,7 @@
)
+ #TESTED
def getFile(self,
key,
filename,
@@ -1422,6 +1429,7 @@
)
+ #TESTED
def getKeyInfo(self,
key,
@@ -1479,6 +1487,7 @@
)
+ #TESTED
def subscribeUSK(self, key, dontPoll=True):
"""Asks the node to notify the client when an USK is updated
@param key: (str) key or Uri of the USK to subscribe to
@@ -1490,6 +1499,8 @@
@todo: looks like USK subscribes will persist untill connection is closed. Can they be removed somehow?
"""
+ if hasattr(key, 'toString'):
+ key = key.toString()
msg = message.SubscribeUSK(
URI=key,
DontPoll=dontPoll,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|