SF.net SVN: fclient: [633] trunk/fclient/src/fclient/lib/fcp2/key.py
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-07-15 23:47:21
|
Revision: 633
http://fclient.svn.sourceforge.net/fclient/?rev=633&view=rev
Author: jUrner
Date: 2008-07-15 16:47:21 -0700 (Tue, 15 Jul 2008)
Log Message:
-----------
looks like edition number is not mandatory for SSKs
Modified Paths:
--------------
trunk/fclient/src/fclient/lib/fcp2/key.py
Modified: trunk/fclient/src/fclient/lib/fcp2/key.py
===================================================================
--- trunk/fclient/src/fclient/lib/fcp2/key.py 2008-07-15 23:46:02 UTC (rev 632)
+++ trunk/fclient/src/fclient/lib/fcp2/key.py 2008-07-15 23:47:21 UTC (rev 633)
@@ -196,7 +196,7 @@
(?P<extra>[a-z0-9\-~]+?)
)
(
- / (?: (?P<docName>[^/]+?)) - (?: (?P<edition>[\d]+))
+ / (?: (?P<docName>[^/]+?)) (- (?P<edition>[\d]+) )?
(/ (?P<tail>.+?))?
)?
(?P<pManifest> /)?
@@ -225,9 +225,11 @@
else:
out = [self.KeyType + self.keyData, ]
if self.docName is not None:
+ #FIX: i guess from node.config that SSKs do not need an edition number
if self.edition is None:
- raise ValueError('no edition number specified')
- out.append(urllib.quote(self.docName + '-' + str(self.edition)))
+ out.append(urllib.quote(self.docName))
+ else:
+ out.append(urllib.quote(self.docName + '-' + str(self.edition)))
if self.tail is not None:
out.append(urllib.quote(self.tail))
result = posixpath.join(*out)
@@ -246,8 +248,7 @@
if edition is not None:
edition = int(edition)
return clss(d['keyData'], docName=d['docName'], edition=edition, tail=d['tail'], pManifest=bool(d['pManifest']))
-
-
+
#TODO: current impl is to not allow slashes in KSKs. have to check if the node enforces this
class KeyKSK(_KeyBase):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|