Thread: SF.net SVN: fclient:[693] trunk/fclient/src/fclient/lib/fcp2/client.py
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-07-20 10:50:52
|
Revision: 693
http://fclient.svn.sourceforge.net/fclient/?rev=693&view=rev
Author: jUrner
Date: 2008-07-20 10:50:47 +0000 (Sun, 20 Jul 2008)
Log Message:
-----------
filenameCollision consts no longer needed
Modified Paths:
--------------
trunk/fclient/src/fclient/lib/fcp2/client.py
Modified: trunk/fclient/src/fclient/lib/fcp2/client.py
===================================================================
--- trunk/fclient/src/fclient/lib/fcp2/client.py 2008-07-20 10:39:36 UTC (rev 692)
+++ trunk/fclient/src/fclient/lib/fcp2/client.py 2008-07-20 10:50:47 UTC (rev 693)
@@ -1968,11 +1968,14 @@
Global=False,
)
if persistentUserData is not None:
+ oldClientToken = initialRequest['ClientToken']
initialRequest['PersistentUserData'] = persistentUserData
- msg['ClientToken'] = initialRequest.updatePersistentParams()
+ initialRequest.updatePersistentParams()
+ msg['ClientToken'] = initialRequest['ClientToken']
+ initialRequest['ClientToken'] = oldClientToken
if priorityClass is not None:
msg['PriorityClass'] = priorityClass
-
+
self.sendMessage(msg)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-20 11:50:41
|
Revision: 695
http://fclient.svn.sourceforge.net/fclient/?rev=695&view=rev
Author: jUrner
Date: 2008-07-20 11:49:59 +0000 (Sun, 20 Jul 2008)
Log Message:
-----------
bit of an overkill when handling filename collisions
Modified Paths:
--------------
trunk/fclient/src/fclient/lib/fcp2/client.py
Modified: trunk/fclient/src/fclient/lib/fcp2/client.py
===================================================================
--- trunk/fclient/src/fclient/lib/fcp2/client.py 2008-07-20 11:46:26 UTC (rev 694)
+++ trunk/fclient/src/fclient/lib/fcp2/client.py 2008-07-20 11:49:59 UTC (rev 695)
@@ -350,7 +350,7 @@
del self._requests[request['Identifier']]
- def _registerRequest(self,
+ def registerRequest(self,
msg,
requestType,
userData=None,
@@ -672,21 +672,17 @@
# handle filename collisions
elif code == consts.ConstProtocolError.DiskTargetExists:
- handleCollision = initialRequest.get('HandleFilenameCollision', None)
- if handleCollision is not None: # looks like one of our requests
- collisionHandled = initialRequest.get('FilenameCollisionHandled', None)
- if collisionHandled is not None: # one more hint that it is one of our requests
- if handleCollision:
- # rename file and resend request
- initialRequest['FilenameCollisionHandled'] = True
- filename = initialRequest['Filename']
- newFilename = namespace.unique_filename(filename, extensions=1, ispostfixed=collisionHandled)
- initialRequest['Filename'] = newFilename
- initialRequest['Modified'] = {consts.ConstRequestModified.Filename: filename}
- initialRequest.updatePersistentParams()
- self.sendMessage(initialRequest)
- self.events.RequestModified(initialRequest)
- return True
+ if initialRequest['HandleFilenameCollision']:
+ # rename file and resend request
+ filename = initialRequest['Filename']
+ newFilename = namespace.unique_filename(filename, extensions=1, ispostfixed=initialRequest['FilenameCollisionHandled'])
+ initialRequest['FilenameCollisionHandled'] = True
+ initialRequest['Filename'] = newFilename
+ initialRequest['Modified'] = {consts.ConstRequestModified.Filename: filename}
+ initialRequest.updatePersistentParams()
+ self.sendMessage(initialRequest)
+ self.events.RequestModified(initialRequest)
+ return True
# handle plugin related request failures
elif code == consts.ConstProtocolError.NoSuchPlugin or code == consts.ConstProtocolError.AccessDenied:
@@ -1297,7 +1293,7 @@
if value is not None:
msg[paramName] = value
- self._registerRequest(
+ self.registerRequest(
msg,
requestType,
handleFilenameCollision=handleFilenameCollision,
@@ -1527,7 +1523,7 @@
URI=uri,
DontPoll=dontPoll,
)
- self._registerRequest(msg, consts.ConstRequestType.SubscribeUSK)
+ self.registerRequest(msg, consts.ConstRequestType.SubscribeUSK)
msg['RequestStatus'] |= consts.ConstRequestStatus.Completed
self.sendMessage(msg)
return msg['Identifier']
@@ -1680,7 +1676,7 @@
msg.data = data
# finally
- self._registerRequest(
+ self.registerRequest(
msg,
requestType,
persistentUserData=persistentUserData,
@@ -2156,7 +2152,7 @@
PluginName=pluginName,
Detailed=detailed,
)
- self._registerRequest(msg, consts.ConstRequestType.PluginInfo)
+ self.registerRequest(msg, consts.ConstRequestType.PluginInfo)
self.sendMessage(msg)
return msg['Identifier']
@@ -2206,7 +2202,7 @@
requestType = consts.ConstRequestType.GenerateSSKKeypair if keypairType == consts.ConstKeyType.SSK else consts.ConstRequestType.GenerateUSKKeypair
msg = message.MsgGenerateSSK()
- self._registerRequest(msg, requestType)
+ self.registerRequest(msg, requestType)
self.sendMessage(msg)
return msg['Identifier']
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-20 11:54:51
|
Revision: 696
http://fclient.svn.sourceforge.net/fclient/?rev=696&view=rev
Author: jUrner
Date: 2008-07-20 11:53:59 +0000 (Sun, 20 Jul 2008)
Log Message:
-----------
registering requests is mandatory to make the client work
Modified Paths:
--------------
trunk/fclient/src/fclient/lib/fcp2/client.py
Modified: trunk/fclient/src/fclient/lib/fcp2/client.py
===================================================================
--- trunk/fclient/src/fclient/lib/fcp2/client.py 2008-07-20 11:49:59 UTC (rev 695)
+++ trunk/fclient/src/fclient/lib/fcp2/client.py 2008-07-20 11:53:59 UTC (rev 696)
@@ -372,6 +372,7 @@
@param handlePermanentRedirect: (bool) if True, permanent redirect are handled automatically. for example USK@.../-1
will look for the current edition. if handlePermanentRedirect is True, the request is automatically resend to retrieve the current edition
@return: (str) identifer of therequest
+ @note: the client can only deal with requests registered here
@note: the identifier returned is unique to the client but may not be unique to the node
"""
identifier = self.newIdentifier(identifiers=self._requests) if identifier is None else identifier
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-21 10:36:57
|
Revision: 706
http://fclient.svn.sourceforge.net/fclient/?rev=706&view=rev
Author: jUrner
Date: 2008-07-21 10:36:11 +0000 (Mon, 21 Jul 2008)
Log Message:
-----------
update progress on successful completion
Modified Paths:
--------------
trunk/fclient/src/fclient/lib/fcp2/client.py
Modified: trunk/fclient/src/fclient/lib/fcp2/client.py
===================================================================
--- trunk/fclient/src/fclient/lib/fcp2/client.py 2008-07-21 10:32:57 UTC (rev 705)
+++ trunk/fclient/src/fclient/lib/fcp2/client.py 2008-07-21 10:36:11 UTC (rev 706)
@@ -818,6 +818,7 @@
initialRequest['RequestStatus'] |= consts.ConstRequestStatus.Success
initialRequest['MetadataContentType'] = msg.get('Metadata.ContentType', '')
initialRequest['MetadataSize'] = msg.get('DataLength', '')
+ initialRequest['ProgressSucceeeded'] = initialRequest['ProgressRequired']
# except from GetData all requests are complete here. Next GetData will run through AllData...
@@ -1002,6 +1003,7 @@
# we ignore them
initialRequest['RequestStatus'] |= consts.ConstRequestStatus.Success
initialRequest['URI'] = msg['URI']
+ initialRequest['ProgressSucceeeded'] = initialRequest['ProgressRequired']
self._finalizeRequest(msg, initialRequest, self.events.RequestCompleted)
return True
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-27 11:12:29
|
Revision: 760
http://fclient.svn.sourceforge.net/fclient/?rev=760&view=rev
Author: jUrner
Date: 2008-07-27 11:12:38 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
minor change
Modified Paths:
--------------
trunk/fclient/src/fclient/lib/fcp2/client.py
Modified: trunk/fclient/src/fclient/lib/fcp2/client.py
===================================================================
--- trunk/fclient/src/fclient/lib/fcp2/client.py 2008-07-27 11:11:47 UTC (rev 759)
+++ trunk/fclient/src/fclient/lib/fcp2/client.py 2008-07-27 11:12:38 UTC (rev 760)
@@ -479,7 +479,7 @@
if result:
self.sendMessage(
message.MsgClientHello(
- Name=self._connectionName,
+ Name=self.getConnectionName(),
ExpectedVersion=self.ExpectedFcpVersion,
)
)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|