changeset 1023:18b700913f57

Cleanup the use of command line options.
author Martin Geisler <mg@daimi.au.dk>
date Thu, 13 Nov 2008 17:51:34 +0100
parents 3e149ed5f49b
children e38873f66d4a
files apps/divide.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/apps/divide.py	Thu Nov 13 17:50:11 2008 +0100
+++ b/apps/divide.py	Thu Nov 13 17:51:34 2008 +0100
@@ -80,15 +80,15 @@
     parser.add_option("--modulus",
                      help="lower limit for modulus (can be an expression)")
 
-    parser.set_defaults(modulus=2**65, number=None)
+    parser.set_defaults(modulus=2**65)
 
     BasicRuntime.add_options(parser)
 
     options, args = parser.parse_args()
     if len(args)==2:
-        options.number = int(args[1])
+        number = int(args[1])
     else:
-        options.number = None
+        number = None
 
     if len(args) == 0:
         parser.error("you must specify a config file")
@@ -105,12 +105,12 @@
         print "Connected."
 
         # Players 1 and 2 are doing a sharing over the field Zp.
-        # Our input is options.number (none for other players).
+        # Our input is number (none for other players).
         if runtime.id == 3:
             print "I have no number"
         else:
-            print "My number: %d." % options.number
-        (x, y) = runtime.shamir_share([1, 2], Zp, options.number)
+            print "My number: %d." % number
+        (x, y) = runtime.shamir_share([1, 2], Zp, number)
 
         # Do the secret computation.
         result = divide(x, y, 10) # 10 bits for the result.