[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Generate exception messages correctly; remove needless ...



Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.mit.edu:/tmp/cvs-serv2477/lib/mixminion

Modified Files:
	Common.py ClientMain.py BuildMessage.py Config.py 
	MMTPClient.py ServerInfo.py 
Log Message:
Generate exception messages correctly; remove needless space

Index: Common.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/Common.py,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -d -r1.122 -r1.123
--- Common.py	4 Dec 2003 05:02:50 -0000	1.122
+++ Common.py	8 Dec 2003 02:22:56 -0000	1.123
@@ -1476,7 +1476,7 @@
     def replaceContents(self, contents):
         """Replace the current contents of the lockfile with 'contents',
            without releasing the lock.  Invokers must hold the lock."""
-        # XXXX Actually, on Win32, this actually replaces the first 
+        # XXXX Actually, on Win32, this actually replaces the first
         # XXXX len(contents) characters of the lockfile.  This is a bug.
         assert self.count > 0 and self.fd is not None
         SEEK_SET = 0

Index: ClientMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ClientMain.py,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -d -r1.135 -r1.136
--- ClientMain.py	4 Dec 2003 05:50:36 -0000	1.135
+++ ClientMain.py	8 Dec 2003 02:22:56 -0000	1.136
@@ -625,6 +625,7 @@
           - as specified on the command line,
           - as specifed in $MIXMINIONRC
           - in ~/.mixminionrc.
+          - in ~/mixminionrc
 
        If the configuration file is not found in the specified location,
        we create a fresh one.
@@ -632,8 +633,17 @@
     if configFile is None:
         configFile = os.environ.get("MIXMINIONRC")
     if configFile is None:
-        configFile = "~/.mixminionrc"
-    configFile = os.path.expanduser(configFile)
+        for candidate in ["~/.mixminionrc", "~/mixminionrc"]:
+            if os.path.exists(os.path.expanduser(candidate)):
+                configFile = candidate
+                break
+    if configFile is None:
+        if sys.platform == 'win32':
+            configFile = "~/mixminionrc"
+        else:
+            configFile = "~/.mixminionrc"
+    if configFile is not None:
+        configFile = os.path.expanduser(configFile)
 
     if not os.path.exists(configFile):
         print >>sys.stderr,"Writing default configuration file to %r"%configFile
@@ -793,7 +803,7 @@
                 try:
                     self.nHops = int(v)
                     if minHops and self.nHops < minHops:
-                        raise UIError("Must have at least %s hops", minHops)
+                        raise UIError("Must have at least %s hops" % minHops)
                 except ValueError:
                     raise UIError("%s expects an integer"%o)
             elif o in ('-P', '--path'):
@@ -884,7 +894,7 @@
             try:
                 self.exitAddress = mixminion.ClientDirectory.parseAddress(address)
             except ParseError, e:
-                raise UIError("Error in SURBAddress:"+str(e))
+                raise UIError("Error in SURBAddress: %s" % e)
         elif self.exitAddress is None and self.replyBlockFiles == []:
             raise UIError("No recipients specified; exiting. (Try using "
                           "-t <recipient-address>")
@@ -966,6 +976,10 @@
                              or '-' for a reply block read from stdin.
   --subject=<str>, --from=<str>, --in-reply-to=<str>, --references=<str>
                              Specify an email header for the exiting message.
+  --deliver-fragments        If the message is too long to fit in a single
+                             packet, then deliver multiple fragmented packets
+                             to the recipient instead of having the server
+                             reassemble the message.
 %(extra)s
 
 EXAMPLES:
@@ -1237,7 +1251,7 @@
     print "Done."
 
 _LIST_SERVERS_USAGE = """\
-Usage: %(cmd)s [options]
+Usage: %(cmd)s [options] [server names]
 Options:
   -h, --help:                Print this usage message and exit.
   -v, --verbose              Display extra debugging messages.
@@ -1252,6 +1266,7 @@
   -s <str>,--separator=<str> Separate features with <str> instead of tab.
   -c, --cascade              Pretty-print results, cascading by descriptors.
   -C, --cascade-features     Pretty-print results, cascading by features.
+  -J, --justify              Justify features into columns
   -F <name>,--feature=<name> Select which server features to list.
   --list-features            Display a list of all recognized features.
 

Index: BuildMessage.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/BuildMessage.py,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- BuildMessage.py	28 Nov 2003 04:14:03 -0000	1.64
+++ BuildMessage.py	8 Dec 2003 02:22:56 -0000	1.65
@@ -328,8 +328,8 @@
     if err and not explicitSwap:
         raise UIError("Address and path will not fit in one header")
     elif err:
-        raise UIError("Address and %s leg of path will not fit in one header",
-                      ["first", "second"][err-1])
+        raise UIError("Address and %s leg of path will not fit in one header"
+                      % ["first", "second"][err-1])
 
 #----------------------------------------------------------------------
 # MESSAGE DECODING

Index: Config.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/Config.py,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- Config.py	4 Dec 2003 05:52:20 -0000	1.71
+++ Config.py	8 Dec 2003 02:22:56 -0000	1.72
@@ -248,7 +248,7 @@
        Raises ConfigError on failure."""
     host = host.strip()
     if not mixminion.Common.isPlausibleHostname(host):
-        raise ConfigError("%r doesn't look like a valid hostname",host)
+        raise ConfigError("%r doesn't look like a valid hostname"%host)
     return host
 
 # Regular expression to match 'address sets' as used in Allow/Deny
@@ -266,11 +266,11 @@
     s = s.strip()
     m = _address_set_re.match(s)
     if not m:
-        raise ConfigError("Misformatted address rule %r", s)
+        raise ConfigError("Misformatted address rule %r" % s)
     ip, mask, port, porthi = m.groups()
     if ip == '*':
         if mask != None:
-            raise ConfigError("Misformatted address rule %r", s)
+            raise ConfigError("Misformatted address rule %r" % s)
         ip,mask = '0.0.0.0','0.0.0.0'
     else:
         ip = _parseIP(ip)
@@ -444,7 +444,7 @@
         try:
             return _parseInt(s)
         except ConfigError:
-            raise ConfigError("Expected a user name or UID, but got %r",s)
+            raise ConfigError("Expected a user name or UID, but got %r"%s)
 
 #----------------------------------------------------------------------
 

Index: MMTPClient.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/MMTPClient.py,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- MMTPClient.py	28 Nov 2003 04:14:04 -0000	1.44
+++ MMTPClient.py	8 Dec 2003 02:22:56 -0000	1.45
@@ -248,8 +248,8 @@
         LOG.trace("Looking up %s...",routing.hostname)
         family, addr, _ = mixminion.NetUtils.getIP(routing.hostname)
         if family == "NOENT":
-            raise MixProtocolError("Couldn't resolve hostname %s: %s",
-                                   routing.hostname, addr)
+            raise MixProtocolError("Couldn't resolve hostname %s: %s" % (
+                                   routing.hostname, addr))
 
     con = BlockingClientConnection(family,addr,routing.port,routing.keyinfo,
                                    serverName=serverName)

Index: ServerInfo.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ServerInfo.py,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- ServerInfo.py	3 Dec 2003 23:14:26 -0000	1.66
+++ ServerInfo.py	8 Dec 2003 02:22:56 -0000	1.67
@@ -224,7 +224,7 @@
         # Check 'Server' section.
         server = self['Server']
         if server['Descriptor-Version'] != '0.2':
-            raise ConfigError("Unrecognized descriptor version %r",
+            raise ConfigError("Unrecognized descriptor version %r" %
                               server['Descriptor-Version'])
 
         ####