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

jr at conuropsis.org jr at conuropsis.org
Thu May 19 21:28:42 CEST 2005


Author: jr
Date: 2005-05-19 21:28:41 +0200 (Thu, 19 May 2005)
New Revision: 262

Modified:
   trunk/nym3/Client/Main.py
Log:
index synopses by their XNymSeq in dump-syn and list-syn commands


Modified: trunk/nym3/Client/Main.py
===================================================================
--- trunk/nym3/Client/Main.py	2005-05-19 19:13:27 UTC (rev 261)
+++ trunk/nym3/Client/Main.py	2005-05-19 19:28:41 UTC (rev 262)
@@ -400,7 +400,6 @@
     synbox = account.get_synbox()
     mbox = account.get_mbox()
     secring = decode_secring(config, ui)
-    index = 1
     for (midlist, bf, enc_synset) in synbox:
 	bflist = Mail.bf2list(bf)
 	synset = decipher_string(enc_synset, secring, account['encKeys'])
@@ -408,7 +407,6 @@
 	    ui.display("unable to decipher a synopses blob, lost keys?")
 	    #TODO remove the blob?
 	    #TODO if yes remove the following line
-	    index += len(midlist)
 	else:
 	    for i, mid in enumerate(midlist):
 		synlen = Message.strToIntBE(synset[20: 22])
@@ -420,9 +418,9 @@
 		    avail = "email available on server"
 		else:
 		    avail = "email not available"
+		index = Mail.XNymSeq(syn)
 		ui.display("%d %s %s" % (index, binascii.hexlify(mid), avail))
 		ui.display(Mail.syn_summary(syn))
-		index += 1
 
 def dump_syn(ui, config, nickname = None):
     account = get_account_from_nickname(ui, config, nickname,
@@ -430,7 +428,6 @@
     synbox = account.get_synbox()
     mbox = account.get_mbox()
     secring = decode_secring(config, ui)
-    index = 1
     for (midlist, bf, enc_synset) in synbox:
 	bflist = Mail.bf2list(bf)
 	synset = decipher_string(enc_synset, secring, account['encKeys'])
@@ -438,7 +435,6 @@
 	    ui.display("unable to decipher a synopses blob, lost keys?")
 	    #TODO remove the blob?
 	    #TODO if yes remove the following line
-	    index += len(midlist)
 	else:
 	    for i, mid in enumerate(midlist):
 		synlen = Message.strToIntBE(synset[20: 22])
@@ -450,9 +446,9 @@
 		    avail = "email available on server"
 		else:
 		    avail = "email not available"
+		index = Mail.XNymSeq(syn)
 		ui.display("%d %s %s" % (index, binascii.hexlify(mid), avail))
 		ui.display(syn)
-		index += 1
 
 def list_mbox(ui, config, nickname = None):
     account = get_account_from_nickname(ui, config, nickname,



More information about the Nym3-commit mailing list