diff options
Diffstat (limited to 'Demo/scripts/mboxconvert.py')
-rwxr-xr-x | Demo/scripts/mboxconvert.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Demo/scripts/mboxconvert.py b/Demo/scripts/mboxconvert.py index 8da37bf..787c760 100755 --- a/Demo/scripts/mboxconvert.py +++ b/Demo/scripts/mboxconvert.py @@ -91,19 +91,19 @@ def message(f, delimiter = ''): sys.stderr.write( 'Unparseable date: %r\n' % (m.getheader('Date'),)) t = os.fstat(f.fileno())[stat.ST_MTIME] - print 'From', email, time.ctime(t) + print('From', email, time.ctime(t)) # Copy RFC822 header for line in m.headers: - print line, + print(line, end=' ') # Invent Message-ID header if none is present - if not m.has_key('message-id'): + if 'message-id' not in m: global counter counter = counter + 1 msgid = "<%s.%d>" % (hex(t), counter) sys.stderr.write("Adding Message-ID %s (From %s)\n" % (msgid, email)) - print "Message-ID:", msgid - print + print("Message-ID:", msgid) + print() # Copy body while 1: line = f.readline() @@ -115,9 +115,9 @@ def message(f, delimiter = ''): break if line[:5] == 'From ': line = '>' + line - print line, + print(line, end=' ') # Print trailing newline - print + print() return sts if __name__ == "__main__": |