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

[minion-cvs] Make mixminion decode default to stdin



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

Modified Files:
	ClientMain.py 
Log Message:
Make mixminion decode default to stdin

Index: ClientMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ClientMain.py,v
retrieving revision 1.169
retrieving revision 1.170
diff -u -d -r1.169 -r1.170
--- ClientMain.py	23 Mar 2004 00:13:55 -0000	1.169
+++ ClientMain.py	23 Mar 2004 00:20:53 -0000	1.170
@@ -1156,7 +1156,7 @@
     if not options:
         sendUsageAndExit(cmd)
 
-    inFile = None
+    inFile = '-'
     h_subject = h_from = h_irt = h_references = None
     no_ss_fragment = 0
     for opt,val in options:
@@ -1196,7 +1196,7 @@
     except MixError, e:
         raise UIError("Invalid headers: %s"%e)
 
-    if inFile in (None, '-') and '-' in parser.replyBlockSources:
+    if inFile == '-' and '-' in parser.replyBlockSources:
         raise UIError(
             "Can't read both message and reply block from stdin")
 
@@ -1211,7 +1211,7 @@
     address.setHeaders(parseMessageAndHeaders(headerStr+"\n")[1])
 
     # Get our surb, if any.
-    if address.isReply and inFile in ('-', None):
+    if address.isReply and inFile == '-':
         # We check to make sure that we have a valid SURB before reading
         # from stdin.
         surblog = client.openSURBLog()
@@ -1224,16 +1224,13 @@
 
     # Read the message.
     # XXXX Clean up this ugly control structure.
-    if address and inFile is None and not address.hasPayload():
+    if address and inFile == '-' and not address.hasPayload():
         message = None
         LOG.info("Sending dummy message")
     else:
         if address and not address.hasPayload():
             raise UIError("Cannot send a message in a DROP packet")
 
-        if inFile is None:
-            inFile = "-"
-
         try:
             if inFile == '-':
                 print "Enter your message now.  Type %s when you are done."%(
@@ -1567,7 +1564,7 @@
            'output=', 'force', 'input=', 'passphrase-fd=',])
 
     outputFile = '-'
-    inputFile = None
+    inputFile = '-'
     force = 0
     for o,v in options:
         if o in ('-o', '--output'):
@@ -1591,9 +1588,6 @@
             msg += " (Did you mean '-i %s'?)" % args[0]
         raise UIError(msg)
 
-    if not inputFile:
-        raise UIError("No input file specified")
-
     parser.init()
     client = parser.client