CVS: tmda/TMDA ChangeLog,1.285,1.286 Pending.py,1.21,1.22

Timothy Legant <[email protected]>
Newsgroups gmane.mail.spam.tmda.cvs
Message-ID <[email protected]>
Update of /cvsroot/tmda/tmda/TMDA
In directory sc8-pr-cvs1:/tmp/cvs-serv32722/TMDA

Modified Files:
	ChangeLog Pending.py 
Log Message:
After reading message list from stdin in Pending.initQueue, close
stdin and re-open on /dev/tty, so interactive operation is possible.
Also, allow multiple message names on the same line when reading
stdin.


Index: ChangeLog
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/ChangeLog,v
retrieving revision 1.285
retrieving revision 1.286
diff -u -r1.285 -r1.286
--- ChangeLog	20 Aug 2003 00:28:03 -0000	1.285
+++ ChangeLog	21 Aug 2003 19:18:31 -0000	1.286
@@ -1,3 +1,10 @@
+2003-08-21  Tim Legant  <[email protected]>
+
+	* Pending.py (initQueue): After reading message list from stdin,
+	close stdin and re-open on the tty, so interactive operation is
+	possible.  Also, minor change to allow multiple message names on
+	the same line while reading stdin.
+
 2003-08-19  Jason R. Mastaler  <[email protected]>
 
 	* FilterParser.py (_FilterFile.__init__): confirm can now take an

Index: Pending.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/Pending.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- Pending.py	26 May 2003 00:43:05 -0000	1.21
+++ Pending.py	21 Aug 2003 19:18:31 -0000	1.22
@@ -64,7 +64,6 @@
         self.verbose = verbose
         self.younger = younger
         self.pretend = pretend
-        self.wantedstdin = 0
 
         self.stdout = sys.stdout
 
@@ -79,14 +78,18 @@
         # via standard input.  (Since it's pointless to call it twice,
         # it's safe to remove any subsequent occurrences in the list after
         # processing.)
+        wantedstdin = 0
         for msgid in self.msgs:
             if msgid == '-':
-                self.wantedstdin = 1
+                wantedstdin = 1
                 for line in sys.stdin.readlines():
-                    self.msgs.append(line.strip())
+                    self.msgs.extend(line.strip().split())
                 self.msgs.remove('-')
+                # re-open stdin on the tty
+                sys.stdin.close()
+                sys.stdin = open('/dev/tty', 'r')
 
-        if not self.msgs and not self.wantedstdin:
+        if not self.msgs and not wantedstdin:
             cwd = os.getcwd()
             os.chdir(self.pendingdir)
             self.msgs = glob.glob('*.*.msg*')

_______________________________________
tmda-cvs mailing list
http://tmda.net/lists/listinfo/tmda-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.