Skip to content

Commit 39c3fb3

Browse files
Corrects pyserial-asyncio (distribution )versus serial_asyncio (package) naming confusion.
1 parent a1a8cfe commit 39c3fb3

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323

2424

2525
class SerialTransport(asyncio.Transport):
26-
"""An asyncio transport model of a pyserial_asyncio communication channel.
26+
"""An asyncio transport model of a serial_asyncio communication channel.
2727
2828
A transport class is an abstraction of a communication channel.
2929
This allows protocol implementations to be developed against the
3030
transport abstraction without needing to know the details of the
3131
underlying channel, such as whether it is a pipe, a socket, or
32-
indeed a pyserial_asyncio port.
32+
indeed a serial_asyncio port.
3333
3434
3535
You generally won’t instantiate a transport yourself; instead, you
@@ -67,7 +67,7 @@ def serial(self):
6767
return self._serial
6868

6969
def __repr__(self):
70-
return '{self.__class__.__name__}({self._loop}, {self._protocol}, {self.pyserial_asyncio})'.format(self=self)
70+
return '{self.__class__.__name__}({self._loop}, {self._protocol}, {self.serial_asyncio})'.format(self=self)
7171

7272
def is_closing(self):
7373
"""Return True if the transport is closing or closed."""
@@ -108,7 +108,7 @@ def write(self, data):
108108
try:
109109
n = self._serial.write(data)
110110
except serial.SerialException as exc:
111-
self._fatal_error(exc, 'Fatal write error on pyserial_asyncio transport')
111+
self._fatal_error(exc, 'Fatal write error on serial_asyncio transport')
112112
return
113113
if n == len(data):
114114
return # Whole request satisfied
@@ -221,7 +221,7 @@ def _write_ready(self):
221221
222222
This method is called back asynchronously as a writer
223223
registered with the asyncio event-loop against the
224-
underlying file descriptor for the pyserial_asyncio port.
224+
underlying file descriptor for the serial_asyncio port.
225225
226226
Should the write-buffer become empty if this method
227227
is invoked while the transport is closing, the protocol's
@@ -239,7 +239,7 @@ def _write_ready(self):
239239
except (BlockingIOError, InterruptedError):
240240
self._write_buffer.append(data)
241241
except serial.SerialException as exc:
242-
self._fatal_error(exc, 'Fatal write error on pyserial_asyncio transport')
242+
self._fatal_error(exc, 'Fatal write error on serial_asyncio transport')
243243
else:
244244
if n == len(data):
245245
assert self._flushed()
@@ -291,7 +291,7 @@ def _set_write_buffer_limits(self, high=None, low=None):
291291
self._high_water = high
292292
self._low_water = low
293293

294-
def _fatal_error(self, exc, message='Fatal error on pyserial_asyncio transport'):
294+
def _fatal_error(self, exc, message='Fatal error on serial_asyncio transport'):
295295
"""Report a fatal error to the event-loop and abort the transport."""
296296
self._loop.call_exception_handler({
297297
'message': message,
@@ -341,7 +341,7 @@ def _call_connection_lost(self, exc):
341341
"""Close the connection.
342342
343343
Informs the protocol through connection_lost() and clears
344-
pending buffers and closes the pyserial_asyncio connection.
344+
pending buffers and closes the serial_asyncio connection.
345345
"""
346346
assert self._closing
347347
assert not self._has_writer

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def find_version(*file_paths):
4545
raise RuntimeError("Unable to find version string.")
4646

4747

48-
version = find_version('pyserial_asyncio', '__init__.py')
48+
version = find_version('serial_asyncio', '__init__.py')
4949

5050

5151
setup(
@@ -55,7 +55,7 @@ def find_version(*file_paths):
5555
author="Chris Liechti",
5656
author_email="cliechti@gmx.net",
5757
url="https://github.com/pyserial/pyserial",
58-
packages=['pyserial_asyncio'],
58+
packages=['serial_asyncio'],
5959
install_requires=[
6060
'pyserial',
6161
],

test/test_asyncio.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22
#
3-
# This file is part of pySerial-asyncio - Cross platform pyserial_asyncio port support for Python
3+
# This file is part of pySerial-asyncio - Cross platform serial_asyncio port support for Python
44
# (C) 2016 Chris Liechti <cliechti@gmx.net>
55
#
66
# SPDX-License-Identifier: BSD-3-Clause
@@ -19,7 +19,7 @@
1919
import unittest
2020
import asyncio
2121

22-
import pyserial_asyncio
22+
import serial_asyncio
2323

2424
# on which port should the tests be performed:
2525
PORT = '/dev/ttyUSB0'
@@ -30,7 +30,7 @@ class Test_asyncio(unittest.TestCase):
3030

3131
def setUp(self):
3232
self.loop = asyncio.get_event_loop()
33-
# create a closed pyserial_asyncio port
33+
# create a closed serial_asyncio port
3434

3535
def tearDown(self):
3636
self.loop.close()
@@ -65,7 +65,7 @@ def resume_writing(self):
6565
actions.append('resume')
6666
print(self.transport.get_write_buffer_size())
6767

68-
coro = pyserial_asyncio.create_serial_connection(self.loop, Output, PORT, baudrate=115200)
68+
coro = serial_asyncio.create_serial_connection(self.loop, Output, PORT, baudrate=115200)
6969
self.loop.run_until_complete(coro)
7070
self.loop.run_forever()
7171
self.assertEqual(b''.join(received), TEXT)

0 commit comments

Comments
 (0)