[Nym3-commit] r73 - trunk

nym3-devel@lists.noreply.org nym3-devel@lists.noreply.org
Wed, 04 Aug 2004 16:57:38 +0200


Author: laurent
Date: 2004-08-04 16:57:37 +0200 (Wed, 04 Aug 2004)
New Revision: 73

Modified:
   trunk/Main.py
   trunk/User.py
Log:
Correct 'up' use in Main.


Modified: trunk/Main.py
===================================================================
--- trunk/Main.py	2004-08-04 14:48:24 UTC (rev 72)
+++ trunk/Main.py	2004-08-04 14:57:37 UTC (rev 73)
@@ -94,11 +94,11 @@
 		#we ignore the Create command if it comes from the nymholder of an account, should we rise an error?
 		pass
 	    elif (com.ct() == 1):
-		if (nymUser.isInitialized() and (nymUser.data['up'] == False)):
+		if (nymUser.isInitialized() and (nymUser.isUp() == False)):
 		    if(nymUser['cr'] == com.cr):
-			nymUser['up'] = True
+			nymUser.setUp()
 		#if the account is not initialized, or if it is already up we ignore Create2 messages
-	    elif (nymUser.data['up'] == True):
+	    elif (nymUser.isUp() == True):
 		if (com.ct() == 2):
 		    if( len(com.surbs) == 0):
 			nymUser.delSurbs()

Modified: trunk/User.py
===================================================================
--- trunk/User.py	2004-08-04 14:48:24 UTC (rev 72)
+++ trunk/User.py	2004-08-04 14:57:37 UTC (rev 73)
@@ -149,6 +149,7 @@
         self.data['nSurbs'] = 0
 
     def load_mbox(self):
+	if self.__dict__.has_key('mbox'): return
 	mbox = Config.path + os.sep + self.data['username'] + '.mbox'
 	self.lock()
 	try:
@@ -168,6 +169,7 @@
 	self.release()
 	
     def load_synbox(self):
+	if self.__dict__.has_key('syn'): return
 	synbox = Config.path + os.sep + self.data['username'] + '.syn'
 	self.lock()
 	try:
@@ -187,6 +189,7 @@
 	self.release()
     
     def load_index(self):
+	if self.__dict__.has_key('index'): return
 	index = Config.path + os.sep + self.data['username'] + '.idx'
 	self.lock()
 	try:
@@ -237,6 +240,12 @@
 	have arrived"""
 	return (self.data['nSurbs'] > 2) and (self.data['idkey'] != None)
 
+    def isUp(self):
+	return self.data['up']
+
+    def setUp(self):
+	self.data['up'] = True
+
 if __name__ == '__main__':
     a = User('laurent')
     ec = a.relay("NYM3 TEST : " + repr(time.time()))