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

jr at conuropsis.org jr at conuropsis.org
Tue May 3 16:28:54 CEST 2005


Author: jr
Date: 2005-05-03 16:28:54 +0200 (Tue, 03 May 2005)
New Revision: 227

Modified:
   trunk/nym3/Client/Account.py
   trunk/nym3/Client/Main.py
Log:
partial implementation of list-syn + bug correction in Account


Modified: trunk/nym3/Client/Account.py
===================================================================
--- trunk/nym3/Client/Account.py	2005-05-03 11:54:56 UTC (rev 226)
+++ trunk/nym3/Client/Account.py	2005-05-03 14:28:54 UTC (rev 227)
@@ -402,12 +402,12 @@
     def get_synbox(self):
 	"""return a copy of the synbox"""
 	self._load_synbox()
-	return copy.deepcopy(self['synbox'])
+	return copy.deepcopy(self.synbox)
 
     def get_mbox(self):
 	"""return a copy of the mbox"""
 	self._load_mbox()
-	return copy.deepcopy(self['mbox'])
+	return copy.deepcopy(self.mbox)
 
     def add_synset(self, midlist, bf, synset):
 	if self.synbox_status == 'unloaded': self._load_synbox()

Modified: trunk/nym3/Client/Main.py
===================================================================
--- trunk/nym3/Client/Main.py	2005-05-03 11:54:56 UTC (rev 226)
+++ trunk/nym3/Client/Main.py	2005-05-03 14:28:54 UTC (rev 227)
@@ -343,11 +343,31 @@
     idKey = _cr.pk_decode_private_key(secring.get_key(account['idKey']))
     account.sendControl([getmsg], idKey)
 
-def list_syn(ui, config, nickname = None)
+def list_syn(ui, config, nickname = None):
     account = get_account_from_nickname(ui, config, nickname,
 	    "No nickname given, abort\nUse -n <nickname>")
-
-
+    synbox = account.get_synbox()
+    mbox = account.get_mbox()
+    secring = decode_secring(config, ui)
+    index = 1
+    for (midlist, bf, enc_synset) in synbox:
+	synset = decipher_string(enc_synset, secring, account['encKeys'])
+	if synset == None:
+	    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 mid in midlist:
+		synlen = Message.strToIntBE(synset[20: 22])
+		syn = synset[22: 22 + synlen]
+		synset = synset[22 + synlen:]
+		#TODO determine the availability of the message (mbox or server)
+		avail = ""
+		ui.display("%d %s %s" % (index, binascii.hexlify(mid), avail))
+		ui.display(Mail.syn_summary(syn))
+		index += 1
+		
 def main(args):
     if len(args) < 2:
 	print "Usage: WRITEME"



More information about the Nym3-commit mailing list