[Nym3-commit] r323 - trunk/nymbaron/Client

jr at conuropsis.org jr at conuropsis.org
Sat Oct 8 17:05:11 CEST 2005


Author: jr
Date: 2005-10-08 17:05:10 +0200 (Sat, 08 Oct 2005)
New Revision: 323

Modified:
   trunk/nymbaron/Client/Config.py
   trunk/nymbaron/Client/Main.py
Log:
- add default values in the usage strings
- make the default number of surbs sent a configurable parameter


Modified: trunk/nymbaron/Client/Config.py
===================================================================
--- trunk/nymbaron/Client/Config.py	2005-10-08 10:24:39 UTC (rev 322)
+++ trunk/nymbaron/Client/Config.py	2005-10-08 15:05:10 UTC (rev 323)
@@ -46,5 +46,8 @@
 	# Default maximum number of synopsis to request in SUMMARIZE command
 	self.max_syn = 42
 
+	# Default number of surbs to request in SURB command
+	self.nb_surb = 42
+
     def load_from_file(self, filename):
 	pass

Modified: trunk/nymbaron/Client/Main.py
===================================================================
--- trunk/nymbaron/Client/Main.py	2005-10-08 10:24:39 UTC (rev 322)
+++ trunk/nymbaron/Client/Main.py	2005-10-08 15:05:10 UTC (rev 323)
@@ -528,7 +528,8 @@
 	account.record(seqno, m)
 	ui.display("resend message seqno: %s" % binascii.hexlify(seqno))
     
-def SendSurb(ui, config, nickname = None, number = 42):
+def SendSurb(ui, config, nickname = None, number = None):
+    if not number: number = config.nb_surb
     account = get_account_from_nickname(ui, config, nickname,
 	    "No nickname given, abort\nUse -n <nickname>")
     try:
@@ -725,11 +726,13 @@
 			  "of the account whose summaries to request")
 	parser.add_option("-m", "--max", action = "store",
 			  dest = "max", help = "Maximum number of summaries"
-			  " to request", type = "int")
+			  " to request, defaults to Config.max_syn "
+			  "if not given", type = "int")
 	#TODO indicate the defaults
 	parser.add_option("-o", "--older", action = "store",
 			  dest = "older", help = "Retrieve only summaries "
-			  "older than msgid")
+			  "older than msgid, defaults to oldest_mid "
+			  "(a special mid oldest than any other)")
 	(options, args) = parser.parse_args(args[2:])
 	ui = CLI()
 	config = Config.Config()
@@ -775,7 +778,8 @@
 			  "of the account whose surbs to replenish")
 	parser.add_option("-N", "--number", action = "store",
 			  dest = "number", help = "The number "
-			  "of SURBs to send", type = "int", default = 42)
+			  "of SURBs to send, defaults to Config.nb_surb",
+			  type = "int")
 	(options, args) = parser.parse_args(args[2:])
 	ui = CLI()
 	config = Config.Config()
@@ -860,7 +864,7 @@
     if args[1] == "list-journal":
 	parser = OptionParser(usage =
 	"""nymbaron list-journal [options]
-	List the messages sent not acknowledged yet by the server.""")
+	List the sent messages not acknowledged yet by the server.""")
 	parser.add_option("-n", "--nickname", action = "store",
 			    dest = "nickname", help = "The nickname "
 			    "of the account whose journal to list")



More information about the Nym3-commit mailing list