[Nym3-commit] r103 - trunk
nym3-devel@lists.noreply.org
nym3-devel@lists.noreply.org
Fri, 06 Aug 2004 00:37:02 +0200
Author: laurent
Date: 2004-08-06 00:37:00 +0200 (Fri, 06 Aug 2004)
New Revision: 103
Modified:
trunk/Message.py
Log:
Some minor changes.
Modified: trunk/Message.py
===================================================================
--- trunk/Message.py 2004-08-05 22:23:06 UTC (rev 102)
+++ trunk/Message.py 2004-08-05 22:37:00 UTC (rev 103)
@@ -5,7 +5,7 @@
class ParseError(Exception):
"""ParseError : error raised if anything goes wrong during parsing"""
- def __init__(self,value):
+ def __init__(self, value):
self.value = value
def __str__(self):
@@ -45,10 +45,7 @@
else:
return False
lb = map(isMid, l)
- if (reduce(lambda x,y : x and y, lb)):
- return True
- else:
- return False
+ return (reduce(lambda x, y: x and y, lb))
surbLength = Common.surbLength
sigLength = Common.sigLength
@@ -306,7 +303,7 @@
nNym = ord(sr.next(1))
self.pw = "" #what is a proof of work?
self.list = sr.readNymList(start, cs)
- except (ParseError,IndexError):
+ except (ParseError, IndexError):
raise ParseError("Bad Formed Command : Create")
#nNym is redundant, we use it to make sure the message is well formed
if(nNym != len(self.list)):
@@ -707,7 +704,7 @@
return 0
def fromData(self, nym, ch):
- """Fill a Created Object from a nym(str) and a challenge(str) """
+ """Fill a Created Object from a nym(str) and a challenge(str)"""
if len(nym) > 255:
raise BadArgument("Created.fromData : nym too long")
if 1 + len(nym) + len(ch) >= pow(256, 3):