diff options
author | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2009-08-05 12:44:46 +0000 |
---|---|---|
committer | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2009-08-05 12:44:46 +0000 |
commit | 435a356e0ee5b9a08f4e37acc0fe9c2d728548b1 (patch) | |
tree | 6a8cdefd685ca8f22108a3d99fbd7da94ba88b9c | |
parent | 45509e198837b639fb9e1d3bf29060d7784098d2 (diff) | |
download | pyserial-435a356e0ee5b9a08f4e37acc0fe9c2d728548b1.tar.gz |
- rename RFC2217 server helper class
- better names in example code
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@296 f19166aa-fa4f-0410-85c2-fa1106f25c8a
-rw-r--r-- | examples/tcp_serial_redirect.py | 11 | ||||
-rw-r--r-- | serial/rfc2217.py | 2 |
2 files changed, 6 insertions, 7 deletions
diff --git a/examples/tcp_serial_redirect.py b/examples/tcp_serial_redirect.py index 7bfe5d8..896e0a0 100644 --- a/examples/tcp_serial_redirect.py +++ b/examples/tcp_serial_redirect.py @@ -26,17 +26,16 @@ class Redirector: self.ser_newline = ser_newline self.net_newline = net_newline self.spy = spy - self.rfc2217 = rfc2217 self._write_lock = threading.Lock() - if self.rfc2217: - self.manager = serial.rfc2217.RFC2217Manager(self.serial, self, debug_output=False) + if rfc2217: + self.rfc2217 = serial.rfc2217.PortManager(self.serial, self, debug_output=False) else: - self.manager = None + self.rfc2217 = None def statusline_poller(self): while self.alive: time.sleep(1) - self.manager.check_modem_lines() + self.rfc2217.check_modem_lines() def shortcut(self): """connect the serial port to the TCP port by copying everything @@ -97,7 +96,7 @@ class Redirector: if not data: break if self.rfc2217: - data = ''.join(self.manager.filter(data)) + data = ''.join(self.rfc2217.filter(data)) if self.ser_newline and self.net_newline: # do the newline conversion # XXX fails for CR+LF in input when it is cut in half at the begin or end of the string diff --git a/serial/rfc2217.py b/serial/rfc2217.py index e4a4e8d..8f1bbe9 100644 --- a/serial/rfc2217.py +++ b/serial/rfc2217.py @@ -794,7 +794,7 @@ else: # ### # The following is code that helps implementing an RFC2217 server. -class RFC2217Manager(object): +class PortManager(object): """This class manages the state of Telnet and RFC2217. It needs a serial instance and a connection to work with. connection is expected to implement a thread safe write function""" |