[Nym3-commit] r129 - trunk/nym3/Client

nym3-devel@lists.noreply.org nym3-devel@lists.noreply.org
Wed, 25 Aug 2004 02:06:04 +0200


Author: laurent
Date: 2004-08-25 02:06:01 +0200 (Wed, 25 Aug 2004)
New Revision: 129

Modified:
   trunk/nym3/Client/Main.py
   trunk/nym3/Client/User.py
Log:
The whitespace is not part of the token, but the token is useless without it.
-+- Lao Tseu - The Secret and Ancient Art of Programming.


Modified: trunk/nym3/Client/Main.py
===================================================================
--- trunk/nym3/Client/Main.py	2004-08-24 23:52:41 UTC (rev 128)
+++ trunk/nym3/Client/Main.py	2004-08-25 00:06:01 UTC (rev 129)
@@ -43,7 +43,7 @@
         nym3.Client.Config.DEBUG = True
     def setUser(option, opt, value, parser):
         try:
-            nymUser = User.User(idTag =value, create = 0)
+            nymUser = User.User(idTag = value, create = 0)
         except User.NoSuchUser:
             print "the nym account %s does not exist" % value
             sys.exit(2)
@@ -64,7 +64,7 @@
     def setDefaultUser():
         setUser(None, "", Config.defaultUser, None)
 
-    def myParseArgs(p,l):
+    def myParseArgs(p, l):
         ret = p.parse_args(l)
         if nymUser == None:
             setDefaultUser()
@@ -84,13 +84,18 @@
 			     help = "determine the user account to be used")
     # ", Client.Config.DefaultUser by default")
     # how helpful is that supposed to be to the user?
-    taggedUserOption = make_option("-t","--tag", action = "callback", callback = setUserTagged, type = "string", help = "determine the user account to be used from a tag")
+    taggedUserOption = make_option("-t", "--tag", action = "callback", 
+				   callback = setUserTagged,
+				   type = "string", help = "determine the\
+				   user account to be used from a tag")
     
     if sys.argv[1] == 'setup':
         parser.usage = "%prog setup [options] nym1 [nym2 [...]]"
-        parser.add_option("-t","--tag", dest = "tag", default = "", help = "the tag that the user wish to associate with the new account")
+        parser.add_option("-t", "--tag", dest = "tag", default = "", 
+	    help = "the tag that the user wish to associate with \
+	    the new account")
         (options, args) = parser.parse_args(sys.argv[2:])
-        nymUser=User.User(tag = options.tag, create = 1)
+        nymUser = User.User(tag = options.tag, create = 1)
         #generate message to send            
     #if sys.argv[1] == 'control': #handling of fragments (pipe to mixminion ...
     #    pass

Modified: trunk/nym3/Client/User.py
===================================================================
--- trunk/nym3/Client/User.py	2004-08-24 23:52:41 UTC (rev 128)
+++ trunk/nym3/Client/User.py	2004-08-25 00:06:01 UTC (rev 129)
@@ -15,7 +15,7 @@
         path = Config.path + os.sep + rtag
         #TODO do we add a lock here?
         if not os.access(path, os.F_OK):
-            os.mkdir(path,0700)
+            os.mkdir(path, 0700)
             return rtag
         
 
@@ -90,7 +90,7 @@
         self._lock()
 	try:
             self.home = self.homeDir()
-            if create == 1 or idTag == "" or not os.access(self.home,os.F_OK):
+            if create == 1 or idTag == "" or not os.access(self.home, os.F_OK):
                 raise NoSuchUser
 	    f = open(self.datafile, 'r')
             self.data = pickle.load(f)
@@ -105,7 +105,7 @@
                 self.data = Config.default_settings
                 if tag != "":
                     T = Tag()
-                    T.store(tag,self.idTag)
+                    T.store(tag, self.idTag)
                     del T
         except IOError:
             print "the user account of idTag %s contains some error : impossible to open %s" % idTag, self.datafile
@@ -204,7 +204,7 @@
     def getSeqNo(self):
         return chr(0)*Common.seqNoLength
 
-    def addHeader(self,msg):
+    def addHeader(self, msg):
         h = Header()
         sig = _cr.pk_sign(_cr.sha1(msg), self.data['idKey'])
         h.fromData(self.data['username'], self.getSeqNo(), sig)