diff options
author | Chris Liechti <cliechti@gmx.net> | 2015-08-30 02:20:39 +0200 |
---|---|---|
committer | Chris Liechti <cliechti@gmx.net> | 2015-08-30 02:20:39 +0200 |
commit | 518b0d31aafdb9ea52a47eb850490d652af2ad96 (patch) | |
tree | 346587bfa92c5e813548676bbe818115c87e77ff /serial/serialutil.py | |
parent | 256ea2171c351bbba16c431979896c30ad07aa7b (diff) | |
download | pyserial-git-518b0d31aafdb9ea52a47eb850490d652af2ad96.tar.gz |
doc: update API docs, rename inter_byte_timeout
- inter_character_timeout -> inter_byte_timeout
- keyword args for Serial: rename writeTimeout, interCharTimeout
Diffstat (limited to 'serial/serialutil.py')
-rw-r--r-- | serial/serialutil.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/serial/serialutil.py b/serial/serialutil.py index 5e3597b..26e6059 100644 --- a/serial/serialutil.py +++ b/serial/serialutil.py @@ -117,9 +117,9 @@ class SerialBase(io.RawIOBase): timeout=None, # set a timeout value, None to wait forever xonxoff=False, # enable software flow control rtscts=False, # enable RTS/CTS flow control - writeTimeout=None, # set a timeout for writes + write_timeout=None, # set a timeout for writes dsrdtr=False, # None: use rtscts setting, dsrdtr override if True or False - interCharTimeout=None # Inter-character timeout, None to disable + inter_byte_timeout=None # Inter-character timeout, None to disable ): """\ Initialize comm port object. If a port is given, then the port will be @@ -138,7 +138,7 @@ class SerialBase(io.RawIOBase): self._xonxoff = None # correct value is assigned below through properties self._rtscts = None # correct value is assigned below through properties self._dsrdtr = None # correct value is assigned below through properties - self._inter_character_timeout = None # correct value is assigned below through properties + self._inter_byte_timeout = None # correct value is assigned below through properties self._rs485_mode = None # disabled by default self._rts_state = True self._dtr_state = True @@ -151,11 +151,11 @@ class SerialBase(io.RawIOBase): self.parity = parity self.stopbits = stopbits self.timeout = timeout - self.write_timeout = writeTimeout + self.write_timeout = write_timeout self.xonxoff = xonxoff self.rtscts = rtscts self.dsrdtr = dsrdtr - self.inter_character_timeout = interCharTimeout + self.inter_character_timeout = inter_byte_timeout if port is not None: self.open() @@ -296,13 +296,13 @@ class SerialBase(io.RawIOBase): @property - def inter_character_timeout(self): + def inter_byte_timeout(self): """Get the current inter-character timeout setting.""" return self._interCharTimeout - @inter_character_timeout.setter - def inter_character_timeout(self, ic_timeout): - """Change inter-character timeout setting.""" + @inter_byte_timeout.setter + def inter_byte_timeout(self, ic_timeout): + """Change inter-byte timeout setting.""" if ic_timeout is not None: if ic_timeout < 0: raise ValueError("Not a valid timeout: %r" % ic_timeout) try: @@ -310,7 +310,7 @@ class SerialBase(io.RawIOBase): except TypeError: raise ValueError("Not a valid timeout: %r" % ic_timeout) - self._interCharTimeout = ic_timeout + self._inter_byte_timeout = ic_timeout if self.is_open: self._reconfigure_port() |