Skip to content

Commit

Permalink
seriallog: minor printing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
modul committed May 20, 2012
1 parent 0612ff6 commit f9dcf43
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions seriallog.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import time
from argparse import FileType, ArgumentParser

__version__ = "0.3"
__version__ = "0.3.1"

def mk_date(fmt):
''' Return a wrapper for strftime(fmt) '''
Expand Down Expand Up @@ -125,20 +125,20 @@ def _formatter(line):
while 1:
if args.send:
for cmd in args.send:
port.write(cmd+eol)
print >> port, cmd+eol,

incoming = port.readlines()
if not incoming:
continue

for line in incoming:
buf = fmt(line)
buf = fmt(line).strip()

if not args.quiet:
print buf,
print buf

if args.logfile:
print >> args.logfile, buf,
print >> args.logfile, buf
args.logfile.flush()

except KeyboardInterrupt:
Expand Down

0 comments on commit f9dcf43

Please sign in to comment.