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

nym3-devel@lists.noreply.org nym3-devel@lists.noreply.org
Wed, 25 Aug 2004 00:56:00 +0200


Author: laurent
Date: 2004-08-25 00:55:59 +0200 (Wed, 25 Aug 2004)
New Revision: 127

Modified:
   trunk/nym3/Client/Main.py
   trunk/nym3/Client/User.py
Log:
Please don't revert my changes back to poorly spaced code, thanks a lot.


Modified: trunk/nym3/Client/Main.py
===================================================================
--- trunk/nym3/Client/Main.py	2004-08-24 21:51:53 UTC (rev 126)
+++ trunk/nym3/Client/Main.py	2004-08-24 22:55:59 UTC (rev 127)
@@ -49,7 +49,7 @@
             sys.exit(2)
 
     def setDefaultUser():
-        setUser(None,"",Config.defaultUser,None)
+        setUser(None, "", Config.defaultUser, None)
 
     def myParseArgs(p,l):
         ret = p.parse_args(l)
@@ -63,8 +63,14 @@
     nymUser = None
     
     #TODO put here options common to every command
-    parser.add_option("-D","--debug", action = "callback", callback = setDebug, help = "output message on stdout instead of sending them through mixminion")
-    userOption = make_option("-u","--user", action = "callback", callback = setUser, type = "string", help = "determine the user account to be used, Client.Config.DefaultUser by default")
+    parser.add_option("-D", "--debug", action = "callback", 
+		      callback = setDebug, help = "output message on stdout\
+		      instead of sending them through mixminion")
+    userOption = make_option("-u", "--user", action = "callback", 
+			     callback = setUser, type = "string",
+			     help = "determine the user account to be used")
+    # ", Client.Config.DefaultUser by default")
+    # how helpful is that supposed to be to the user?
     
     if sys.argv[1] == 'setup':
         parser.usage = "%prog setup [options] nym1 [nym2 [...]]"

Modified: trunk/nym3/Client/User.py
===================================================================
--- trunk/nym3/Client/User.py	2004-08-24 21:51:53 UTC (rev 126)
+++ trunk/nym3/Client/User.py	2004-08-24 22:55:59 UTC (rev 127)
@@ -61,7 +61,7 @@
 
 class User:
     """Hold user data"""
-    def __init__(self, idTag="", create = 0):
+    def __init__(self, idTag = "", create = 0):
         #TODO what is the criteria determining which account we must load? For the time being we only have a user account
         """0 : load user data correspondig to idTag, throw an error if the account doesn't exist
         1 : create a new account (do not take into account idTag) throw an error if it already exist
@@ -77,7 +77,7 @@
 	self.data = None
         self._lock()
 	try:
-            if not os.access(self.home,os.F_OK):
+            if not os.access(self.home, os.F_OK):
                 raise NoSuchUser
 	    f = open(self.datafile, 'r')
             if create == 1:
@@ -109,7 +109,8 @@
 
     def _lock(self):
 	"""Lock the user. For well behaved functions."""
-	self.lock = mixminion.Common.Lockfile(Config.path + os.sep + self.username + '.lck')
+	self.lock = mixminion.Common.Lockfile(Config.path + os.sep +
+		self.username + '.lck')
 	self.lock.acquire()
 
     def _release(self):