summaryrefslogtreecommitdiff
path: root/serial/sermsdos.py
diff options
context:
space:
mode:
authorcliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2009-07-23 14:02:41 +0000
committercliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2009-07-23 14:02:41 +0000
commit2a164cec5efd1ab99e8ed9ed67e2599f54be279e (patch)
tree59161b24111a1cc8f7374869729ed3b0e626d4e6 /serial/sermsdos.py
parent61ca51c63725c5a69633ecbf03b28cb57c09f04d (diff)
downloadpyserial-2a164cec5efd1ab99e8ed9ed67e2599f54be279e.tar.gz
remove print and replace with stdio writes
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@234 f19166aa-fa4f-0410-85c2-fa1106f25c8a
Diffstat (limited to 'serial/sermsdos.py')
-rw-r--r--serial/sermsdos.py23
1 files changed, 4 insertions, 19 deletions
diff --git a/serial/sermsdos.py b/serial/sermsdos.py
index a516118..d4b65dd 100644
--- a/serial/sermsdos.py
+++ b/serial/sermsdos.py
@@ -50,7 +50,7 @@ BAUD_RATES = {
4800: "48",
9600: "96",
19200: "19"}
-
+
(PARITY_NONE, PARITY_EVEN, PARITY_ODD, PARITY_MARK,
PARITY_SPACE) = range(5)
(STOPBITS_ONE, STOPBITS_ONEANDAHALF,
@@ -91,10 +91,10 @@ class Serial(serialutil.FileLike):
):
if type(port) == type(''):
- #strings are taken directly
+ # strings are taken directly
self.portstr = port
else:
- #numbers are transformed to a string
+ # numbers are transformed to a string
self.portstr = device(port+1)
self.baud = BAUD_RATES[baudrate]
@@ -145,7 +145,6 @@ class Serial(serialutil.FileLike):
"""Read num bytes from serial port"""
handle = os.open(self.portstr,
os.O_RDONLY | os.O_BINARY)
- # print os.fstat(handle)
rv = os.read(handle, num)
os.close(handle)
return rv
@@ -197,19 +196,5 @@ class Serial(serialutil.FileLike):
self.retry , self.filename), ' ')
if __name__ == '__main__':
- print __name__
s = Serial(0)
- print s
-
-
-
-
-
-
-
-
-
-
-
-
-
+ sys.stdio.write('%s %s\n' % (__name__, s))