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

jr at conuropsis.org jr at conuropsis.org
Fri Jun 10 15:58:50 CEST 2005


Author: jr
Date: 2005-06-10 15:58:49 +0200 (Fri, 10 Jun 2005)
New Revision: 289

Modified:
   trunk/nym3/Client/Main.py
Log:
rename build_index as build_syn_index and add build_mbox_index


Modified: trunk/nym3/Client/Main.py
===================================================================
--- trunk/nym3/Client/Main.py	2005-06-10 13:08:45 UTC (rev 288)
+++ trunk/nym3/Client/Main.py	2005-06-10 13:58:49 UTC (rev 289)
@@ -136,10 +136,10 @@
 	ui.display("No account relative to the provided nickname, abort")
 	sys.exit(1)
 
-def build_index(ui, config, account):
+def build_syn_index(ui, config, account):
     """Builds the index of synopses of the given account, using ui to get
     the password to decrypt the keyring. Returns a hash containing the
-    correspondance seqNo -> mid"""
+    correspondance index -> mid, where index is a XNymSeq as a str"""
     synbox = account.get_synbox()
     secring = decode_secring(config, ui)
     index = {}
@@ -162,6 +162,13 @@
 		    raise Exception("unable to determine XNymSeq")
     return index
 
+def build_mbox_index(account):
+    """Builds the index of the mbox of the given account. Returns a hash
+    containing the correspondance index -> mid, index has a str"""
+    mbox, index = account.get_mbox()
+    return dict([(str(i), j) for (i, j) in enumerate(index)])
+
+
 def is_hex_mid(s):
     try:
 	ds = binascii.unhexlify(s)
@@ -405,7 +412,7 @@
 	else:
 	    try:
 		l = decode_message_references([older], ['syn'],
-		    {'syn': (build_index, (ui, config, account))})
+		    {'syn': (build_syn_index, (ui, config, account))})
 	    except DecodeException, inst:
 		ui.display(str(inst))
 		sys.exit(1)
@@ -435,7 +442,7 @@
     delmsg = Message.Delete()
     try:
 	midlist = decode_message_references(midlist, ['syn'],
-	        {'syn': (build_index, (ui, config, account))})
+	        {'syn': (build_syn_index, (ui, config, account))})
     except DecodeException, inst:
 	ui.display(str(inst))
 	sys.exit(1)
@@ -459,7 +466,7 @@
     getmsg = Message.Get()
     try:
 	midlist = decode_message_references(midlist, ['syn'],
-	        {'syn': (build_index, (ui, config, account))})
+	        {'syn': (build_syn_index, (ui, config, account))})
     except DecodeException, inst:
 	ui.display(str(inst))
 	sys.exit(1)



More information about the Nym3-commit mailing list