From 3c411c56a4706490fe1481f915e95fe7985ee32d Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Fri, 12 Aug 2022 15:23:50 -0300 Subject: [PATCH 1/2] [REF] Rename escpos folder to pyescpos Signed-off-by: Luis Felipe Mileo --- README.rst | 32 +++++++++++++------------- {escpos => pyescpos}/__init__.py | 4 ++-- {escpos => pyescpos}/asc.py | 2 +- {escpos => pyescpos}/barcode.py | 2 +- {escpos => pyescpos}/config.py | 2 +- {escpos => pyescpos}/conn/__init__.py | 14 +++++------ {escpos => pyescpos}/conn/bt.py | 6 ++--- {escpos => pyescpos}/conn/dummy.py | 4 ++-- {escpos => pyescpos}/conn/file.py | 4 ++-- {escpos => pyescpos}/conn/network.py | 4 ++-- {escpos => pyescpos}/conn/serial.py | 4 ++-- {escpos => pyescpos}/conn/usb.py | 4 ++-- {escpos => pyescpos}/constants.py | 10 ++++---- {escpos => pyescpos}/exceptions.py | 2 +- {escpos => pyescpos}/feature.py | 2 +- {escpos => pyescpos}/helpers.py | 6 ++--- {escpos => pyescpos}/impl/__init__.py | 2 +- {escpos => pyescpos}/impl/bematech.py | 2 +- {escpos => pyescpos}/impl/controlid.py | 2 +- {escpos => pyescpos}/impl/daruma.py | 2 +- {escpos => pyescpos}/impl/elgin.py | 2 +- {escpos => pyescpos}/impl/epson.py | 4 ++-- {escpos => pyescpos}/impl/nitere.py | 2 +- {escpos => pyescpos}/impl/unknown.py | 2 +- {escpos => pyescpos}/retry.py | 8 +++---- {escpos => pyescpos}/showcase.py | 2 +- setup.py | 8 +++---- tests/__init__.py | 2 +- tests/conftest.py | 4 ++-- tests/test_asc.py | 4 ++-- tests/test_bematech.py | 12 +++++----- tests/test_conn_bt.py | 8 +++---- tests/test_conn_dummy.py | 4 ++-- tests/test_conn_file.py | 4 ++-- tests/test_conn_network.py | 4 ++-- tests/test_conn_serial.py | 4 ++-- tests/test_conn_usb.py | 4 ++-- tests/test_controlid_printidtouch.py | 4 ++-- tests/test_daruma_darumageneric.py | 4 ++-- tests/test_daruma_dr700.py | 4 ++-- tests/test_elgin_elgingeneric.py | 4 ++-- tests/test_elgin_i7.py | 4 ++-- tests/test_elgin_i9.py | 6 ++--- tests/test_epson_genericescpos.py | 6 ++--- tests/test_epson_tmt20.py | 4 ++-- tests/test_helpers.py | 12 +++++----- tests/test_nitere_npdv1020.py | 4 ++-- tests/test_retry.py | 6 ++--- tests/test_unknown_cb55c.py | 4 ++-- 49 files changed, 125 insertions(+), 125 deletions(-) rename {escpos => pyescpos}/__init__.py (90%) rename {escpos => pyescpos}/asc.py (99%) rename {escpos => pyescpos}/barcode.py (99%) rename {escpos => pyescpos}/config.py (98%) rename {escpos => pyescpos}/conn/__init__.py (84%) rename {escpos => pyescpos}/conn/bt.py (97%) rename {escpos => pyescpos}/conn/dummy.py (96%) rename {escpos => pyescpos}/conn/file.py (97%) rename {escpos => pyescpos}/conn/network.py (99%) rename {escpos => pyescpos}/conn/serial.py (99%) rename {escpos => pyescpos}/conn/usb.py (99%) rename {escpos => pyescpos}/constants.py (78%) rename {escpos => pyescpos}/exceptions.py (97%) rename {escpos => pyescpos}/feature.py (98%) rename {escpos => pyescpos}/helpers.py (96%) rename {escpos => pyescpos}/impl/__init__.py (97%) rename {escpos => pyescpos}/impl/bematech.py (99%) rename {escpos => pyescpos}/impl/controlid.py (97%) rename {escpos => pyescpos}/impl/daruma.py (99%) rename {escpos => pyescpos}/impl/elgin.py (99%) rename {escpos => pyescpos}/impl/epson.py (99%) rename {escpos => pyescpos}/impl/nitere.py (93%) rename {escpos => pyescpos}/impl/unknown.py (96%) rename {escpos => pyescpos}/retry.py (95%) rename {escpos => pyescpos}/showcase.py (99%) diff --git a/README.rst b/README.rst index c0c974d..5a3ee47 100644 --- a/README.rst +++ b/README.rst @@ -85,7 +85,7 @@ You can get a list of all available implementations with the following snippet: .. sourcecode:: python - from escpos import helpers + from pyescpos import helpers for impl in helpers.find_implementations(sort_by='model.name'): print('{:.<25} {}'.format(impl.model.name, impl.fqname)) @@ -118,8 +118,8 @@ You can connect to your printer through network TCP/IP interface: .. sourcecode:: python - from escpos import NetworkConnection - from escpos.impl.epson import GenericESCPOS + from pyescpos import NetworkConnection + from pyescpos.impl.epson import GenericESCPOS conn = NetworkConnection.create('10.0.0.101:9100') printer = GenericESCPOS(conn) @@ -138,8 +138,8 @@ Here is how you can make a Serial connection: .. sourcecode:: python - from escpos import SerialConnection - from escpos.impl.epson import GenericESCPOS + from pyescpos import SerialConnection + from pyescpos.impl.epson import GenericESCPOS # connect to port 'ttyS5' @ 9600 Bps, assuming RTS/CTS for handshaking conn = SerialConnection.create('/dev/ttyS5:9600,8,1,N') @@ -159,8 +159,8 @@ Here is how you can make a Bluetooth connection: .. sourcecode:: python - from escpos import BluetoothConnection - from escpos.impl.epson import GenericESCPOS + from pyescpos import BluetoothConnection + from pyescpos.impl.epson import GenericESCPOS # uses SPD (service port discovery) services to find which port to connect to conn = BluetoothConnection.create('00:01:02:03:04:05') @@ -185,8 +185,8 @@ Here is how you can make an USB connection: .. sourcecode:: python - from escpos.ifusb import USBConnection - from escpos.impl.elgin import ElginRM22 + from pyescpos.ifusb import USBConnection + from pyescpos.impl.elgin import ElginRM22 conn = USBConnection.create('20d1:7008,interface=0,ep_out=3,ep_in=0') printer = ElginRM22(conn) @@ -205,8 +205,8 @@ extremely unreliable and produce many arbitrary errors. .. sourcecode:: python - from escpos import FileConnection - from escpos.impl.elgin import ElginI9 + from pyescpos import FileConnection + from pyescpos.impl.elgin import ElginI9 conn = FileConnection('/dev/usb/lp1') printer = ElginI9(conn) @@ -223,8 +223,8 @@ of the “output” as raw ESC/POS in a string and returns that. .. sourcecode:: python - from escpos import DummyConnection - from escpos.impl.epson import GenericESCPOS + from pyescpos import DummyConnection + from pyescpos.impl.epson import GenericESCPOS conn = DummyConnection() printer = GenericESCPOS(conn) @@ -242,9 +242,9 @@ barcode as you asked. .. sourcecode:: python - from escpos import barcode - from escpos import SerialConnection - from escpos.impl.epson import GenericESCPOS + from pyescpos import barcode + from pyescpos import SerialConnection + from pyescpos.impl.epson import GenericESCPOS conn = SerialConnection.create('COM1:9600,8,1,N') printer = GenericESCPOS(conn) diff --git a/escpos/__init__.py b/pyescpos/__init__.py similarity index 90% rename from escpos/__init__.py rename to pyescpos/__init__.py index 6a88bf1..aa0e66a 100644 --- a/escpos/__init__.py +++ b/pyescpos/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/__init__.py +# pyescpos/__init__.py # # Copyright 2015 Base4 Sistemas Ltda ME # @@ -25,7 +25,7 @@ __version__ = '0.4' -logging.getLogger('escpos').addHandler(logging.NullHandler()) +logging.getLogger('pyescpos').addHandler(logging.NullHandler()) from .conn import * # noqa: E402,F401,F403 diff --git a/escpos/asc.py b/pyescpos/asc.py similarity index 99% rename from escpos/asc.py rename to pyescpos/asc.py index f5d0732..f3bd9b8 100644 --- a/escpos/asc.py +++ b/pyescpos/asc.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/asc.py +# pyescpos/asc.py # # Copyright 2015 Base4 Sistemas Ltda ME # diff --git a/escpos/barcode.py b/pyescpos/barcode.py similarity index 99% rename from escpos/barcode.py rename to pyescpos/barcode.py index 5f33250..e7b7ab8 100644 --- a/escpos/barcode.py +++ b/pyescpos/barcode.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/barcode.py +# pyescpos/barcode.py # # Copyright 2015 Base4 Sistemas Ltda ME # diff --git a/escpos/config.py b/pyescpos/config.py similarity index 98% rename from escpos/config.py rename to pyescpos/config.py index 08b70ab..6a1e805 100644 --- a/escpos/config.py +++ b/pyescpos/config.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/config.py +# pyescpos/config.py # # Copyright 2018 Base4 Sistemas Ltda ME # diff --git a/escpos/conn/__init__.py b/pyescpos/conn/__init__.py similarity index 84% rename from escpos/conn/__init__.py rename to pyescpos/conn/__init__.py index e3db742..df11657 100644 --- a/escpos/conn/__init__.py +++ b/pyescpos/conn/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/conn/__init__.py +# pyescpos/conn/__init__.py # # Copyright 2018 Base4 Sistemas Ltda ME # @@ -62,32 +62,32 @@ CONNECTION_TYPES = ( (BLUETOOTH, ConnectionTypeInfo( name='Bluetooth', - fqname='escpos.conn.bt.BluetoothConnection', + fqname='pyescpos.conn.bt.BluetoothConnection', type=BluetoothConnection)), (DUMMY, ConnectionTypeInfo( name='Dummy', - fqname='escpos.conn.dummy.DummyConnection', + fqname='pyescpos.conn.dummy.DummyConnection', type=DummyConnection)), (FILE, ConnectionTypeInfo( name='File', - fqname='escpos.conn.file.FileConnection', + fqname='pyescpos.conn.file.FileConnection', type=FileConnection)), (NETWORK, ConnectionTypeInfo( name='Network', - fqname='escpos.conn.network.NetworkConnection', + fqname='pyescpos.conn.network.NetworkConnection', type=NetworkConnection)), (SERIAL, ConnectionTypeInfo( name='Serial (RS-232)', - fqname='escpos.conn.serial.SerialConnection', + fqname='pyescpos.conn.serial.SerialConnection', type=SerialConnection)), (USB, ConnectionTypeInfo( name='USB', - fqname='escpos.conn.usb.USBConnection', + fqname='pyescpos.conn.usb.USBConnection', type=USBConnection)), ) """Known implementations for connection with printers.""" diff --git a/escpos/conn/bt.py b/pyescpos/conn/bt.py similarity index 97% rename from escpos/conn/bt.py rename to pyescpos/conn/bt.py index 920492d..b8cf72b 100644 --- a/escpos/conn/bt.py +++ b/pyescpos/conn/bt.py @@ -42,7 +42,7 @@ from ..retry import backoff -logger = logging.getLogger('escpos.conn.bt') +logger = logging.getLogger('pyescpos.conn.bt') class BluetoothConnectionError(Exception): @@ -103,8 +103,8 @@ def create(cls, settings): .. sourcecode:: python - from escpos import BluetoothConnection - from escpos.impl.epson import GenericESCPOS + from pyescpos import BluetoothConnection + from pyescpos.impl.epson import GenericESCPOS conn = BluetoothConnection.create('00:01:02:03:04:05') printer = GenericESCPOS(conn) diff --git a/escpos/conn/dummy.py b/pyescpos/conn/dummy.py similarity index 96% rename from escpos/conn/dummy.py rename to pyescpos/conn/dummy.py index 311e5c8..21c20ba 100644 --- a/escpos/conn/dummy.py +++ b/pyescpos/conn/dummy.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/conn/dummy.py +# pyescpos/conn/dummy.py # # Copyright 2017 KMEE INFORMATICA LTDA # @@ -25,7 +25,7 @@ from ..helpers import hexdump -logger = logging.getLogger('escpos.conn.dummy') +logger = logging.getLogger('pyescpos.conn.dummy') class DummyConnection(object): diff --git a/escpos/conn/file.py b/pyescpos/conn/file.py similarity index 97% rename from escpos/conn/file.py rename to pyescpos/conn/file.py index e1a4bcf..5b07653 100644 --- a/escpos/conn/file.py +++ b/pyescpos/conn/file.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/conn/file.py +# pyescpos/conn/file.py # # Copyright 2017 KMEE INFORMATICA LTDA # @@ -27,7 +27,7 @@ from ..helpers import hexdump -logger = logging.getLogger('escpos.conn.file') +logger = logging.getLogger('pyescpos.conn.file') @python_2_unicode_compatible diff --git a/escpos/conn/network.py b/pyescpos/conn/network.py similarity index 99% rename from escpos/conn/network.py rename to pyescpos/conn/network.py index be621df..14fae36 100644 --- a/escpos/conn/network.py +++ b/pyescpos/conn/network.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/conn/network.py +# pyescpos/conn/network.py # # Copyright 2015 Base4 Sistemas Ltda ME # @@ -75,7 +75,7 @@ def _network_exception_handler_for_write(ex): return isinstance(ex, _RETRY_EXCEPTIONS) -logger = logging.getLogger('escpos.conn.network') +logger = logging.getLogger('pyescpos.conn.network') @python_2_unicode_compatible diff --git a/escpos/conn/serial.py b/pyescpos/conn/serial.py similarity index 99% rename from escpos/conn/serial.py rename to pyescpos/conn/serial.py index 2a4dfc9..d11811a 100644 --- a/escpos/conn/serial.py +++ b/pyescpos/conn/serial.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/conn/serial.py +# pyescpos/conn/serial.py # # Copyright 2015 Base4 Sistemas Ltda ME # @@ -54,7 +54,7 @@ ) -logger = logging.getLogger('escpos.conn.serial') +logger = logging.getLogger('pyescpos.conn.serial') def depends_on_pyserial_lib(func): diff --git a/escpos/conn/usb.py b/pyescpos/conn/usb.py similarity index 99% rename from escpos/conn/usb.py rename to pyescpos/conn/usb.py index 94b3533..64b6096 100644 --- a/escpos/conn/usb.py +++ b/pyescpos/conn/usb.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/usb.py +# pyescpos/usb.py # # Copyright 2017 Base4 Sistemas Ltda ME # @@ -40,7 +40,7 @@ PRINTER_CLASS = 0x07 -logger = logging.getLogger('escpos.conn.usb') +logger = logging.getLogger('pyescpos.conn.usb') def depends_on_pyusb_lib(func): diff --git a/escpos/constants.py b/pyescpos/constants.py similarity index 78% rename from escpos/constants.py rename to pyescpos/constants.py index a239e30..af1b3b1 100644 --- a/escpos/constants.py +++ b/pyescpos/constants.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/constants.py +# pyescpos/constants.py # # Copyright 2015 Base4 Sistemas Ltda ME # @@ -26,16 +26,16 @@ CASHDRAWER_DEFAULT_DURATION = 200 """Duration for cash drawer activation (kick) in milliseconds. -See :meth:`~escpos.impl.epson.GenericESCPOS.kick_drawer` method for details. +See :meth:`~pyescpos.impl.epson.GenericESCPOS.kick_drawer` method for details. """ BACKOFF_DEFAULT_MAXTRIES = 3 -"""Number of tries before give up. See :func:`escpos.retry.backoff`""" +"""Number of tries before give up. See :func:`pyescpos.retry.backoff`""" BACKOFF_DEFAULT_DELAY = 3 -"""Delay between retries (in seconds). See :func:`escpos.retry.backoff`""" +"""Delay between retries (in seconds). See :func:`pyescpos.retry.backoff`""" BACKOFF_DEFAULT_FACTOR = 2 """Multiply factor in which delay will be increased for the next retry. -See :func:`escpos.retry.backoff`. +See :func:`pyescpos.retry.backoff`. """ diff --git a/escpos/exceptions.py b/pyescpos/exceptions.py similarity index 97% rename from escpos/exceptions.py rename to pyescpos/exceptions.py index de5931d..444a200 100644 --- a/escpos/exceptions.py +++ b/pyescpos/exceptions.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/exceptions.py +# pyescpos/exceptions.py # # Copyright 2015 Base4 Sistemas Ltda ME # diff --git a/escpos/feature.py b/pyescpos/feature.py similarity index 98% rename from escpos/feature.py rename to pyescpos/feature.py index 44f71bf..66932ca 100644 --- a/escpos/feature.py +++ b/pyescpos/feature.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/feature.py +# pyescpos/feature.py # # Copyright 2015 Base4 Sistemas Ltda ME # diff --git a/escpos/helpers.py b/pyescpos/helpers.py similarity index 96% rename from escpos/helpers.py rename to pyescpos/helpers.py index ac70a74..54f77d5 100644 --- a/escpos/helpers.py +++ b/pyescpos/helpers.py @@ -43,9 +43,9 @@ def find_implementations(sort_by=None): """ - Returns a tuple of :class:`~escpos.helpers.Implementation` objects + Returns a tuple of :class:`~pyescpos.helpers.Implementation` objects containing metadata for all known implementations (subclasses of - :class:`~escpos.impl.epson.GenericESCPOS`) with vendor and model names, the + :class:`~pyescpos.impl.epson.GenericESCPOS`) with vendor and model names, the implementation type and its fully qualified name. This example will print all vendor and model names, sorted by vendor name: @@ -184,7 +184,7 @@ def is_value_in(constants_group, value): def _list_impls(): - from escpos.impl.epson import GenericESCPOS + from pyescpos.impl.epson import GenericESCPOS return _impls_for(GenericESCPOS) diff --git a/escpos/impl/__init__.py b/pyescpos/impl/__init__.py similarity index 97% rename from escpos/impl/__init__.py rename to pyescpos/impl/__init__.py index e0e8064..c851e83 100644 --- a/escpos/impl/__init__.py +++ b/pyescpos/impl/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/impl/__init__.py +# pyescpos/impl/__init__.py # # Copyright 2015 Base4 Sistemas Ltda ME # diff --git a/escpos/impl/bematech.py b/pyescpos/impl/bematech.py similarity index 99% rename from escpos/impl/bematech.py rename to pyescpos/impl/bematech.py index 7bc7b6d..1f58d26 100644 --- a/escpos/impl/bematech.py +++ b/pyescpos/impl/bematech.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/impl/bematech.py +# pyescpos/impl/bematech.py # # Copyright 2015 Base4 Sistemas Ltda ME # diff --git a/escpos/impl/controlid.py b/pyescpos/impl/controlid.py similarity index 97% rename from escpos/impl/controlid.py rename to pyescpos/impl/controlid.py index 6d65801..e5665f4 100644 --- a/escpos/impl/controlid.py +++ b/pyescpos/impl/controlid.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/impl/controlid.py +# pyescpos/impl/controlid.py # # Copyright 2021 Base4 Sistemas # diff --git a/escpos/impl/daruma.py b/pyescpos/impl/daruma.py similarity index 99% rename from escpos/impl/daruma.py rename to pyescpos/impl/daruma.py index 749213d..cfe00cc 100644 --- a/escpos/impl/daruma.py +++ b/pyescpos/impl/daruma.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/impl/daruma.py +# pyescpos/impl/daruma.py # # Copyright 2015 Base4 Sistemas Ltda ME # diff --git a/escpos/impl/elgin.py b/pyescpos/impl/elgin.py similarity index 99% rename from escpos/impl/elgin.py rename to pyescpos/impl/elgin.py index baff736..c602f64 100644 --- a/escpos/impl/elgin.py +++ b/pyescpos/impl/elgin.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/impl/elgin.py +# pyescpos/impl/elgin.py # # Copyright 2015 Base4 Sistemas Ltda ME # diff --git a/escpos/impl/epson.py b/pyescpos/impl/epson.py similarity index 99% rename from escpos/impl/epson.py rename to pyescpos/impl/epson.py index 166d975..056eeb3 100644 --- a/escpos/impl/epson.py +++ b/pyescpos/impl/epson.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/impl/epson.py +# pyescpos/impl/epson.py # # Copyright 2015 Base4 Sistemas Ltda ME # @@ -422,7 +422,7 @@ def code128(self, data, **kwargs): :param str data: The Code 128 data to be rendered. :param bytes codeset: Optional. Keyword argument for the subtype (code - set) to render. Defaults to :attr:`escpos.barcode.CODE128_A`. + set) to render. Defaults to :attr:`pyescpos.barcode.CODE128_A`. .. warning:: diff --git a/escpos/impl/nitere.py b/pyescpos/impl/nitere.py similarity index 93% rename from escpos/impl/nitere.py rename to pyescpos/impl/nitere.py index 3a316b4..d172177 100644 --- a/escpos/impl/nitere.py +++ b/pyescpos/impl/nitere.py @@ -28,7 +28,7 @@ class NitereNPDV1020(CB55C): - """Alias for **Unknown OEM** :class:`~escpos.impl.unknown.CB55C` model.""" + """Alias for **Unknown OEM** :class:`~pyescpos.impl.unknown.CB55C` model.""" model = _Model(name='Nitere NPDV-1020', vendor=VENDOR) diff --git a/escpos/impl/unknown.py b/pyescpos/impl/unknown.py similarity index 96% rename from escpos/impl/unknown.py rename to pyescpos/impl/unknown.py index f350bb3..a208f12 100644 --- a/escpos/impl/unknown.py +++ b/pyescpos/impl/unknown.py @@ -39,7 +39,7 @@ class CB55C(GenericESCPOS): .. note:: When there is **NO** cash drawer connected, the command that follows - method :meth:`~escpos.impl.epson.GenericESCPOS.kick_drawer` will likely + method :meth:`~pyescpos.impl.epson.GenericESCPOS.kick_drawer` will likely fail. """ diff --git a/escpos/retry.py b/pyescpos/retry.py similarity index 95% rename from escpos/retry.py rename to pyescpos/retry.py index c6f2b76..69a75e0 100644 --- a/escpos/retry.py +++ b/pyescpos/retry.py @@ -26,7 +26,7 @@ from . import constants -logger = logging.getLogger('escpos.retry') +logger = logging.getLogger('pyescpos.retry') def always_retry(e): @@ -55,14 +55,14 @@ def backoff( the *Python Decorator Library*. :param int max_tries: Number of tries before give up. Defaults to - :const:`~escpos.constants.BACKOFF_DEFAULT_MAXTRIES`. + :const:`~pyescpos.constants.BACKOFF_DEFAULT_MAXTRIES`. :param int delay: Delay between retries (in seconds). Defaults to - :const:`~escpos.constants.BACKOFF_DEFAULT_DELAY`. + :const:`~pyescpos.constants.BACKOFF_DEFAULT_DELAY`. :param int factor: Multiply factor in which delay will be increased for the next retry. Defaults to - :const:`~escpos.constants.BACKOFF_DEFAULT_FACTOR`. + :const:`~pyescpos.constants.BACKOFF_DEFAULT_FACTOR`. :param exception_handler: Optional callable. Back off algorithm will call this handler upon any exception that happens in the decorated function. diff --git a/escpos/showcase.py b/pyescpos/showcase.py similarity index 99% rename from escpos/showcase.py rename to pyescpos/showcase.py index 425709a..e820725 100644 --- a/escpos/showcase.py +++ b/pyescpos/showcase.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/showcase.py +# pyescpos/showcase.py # # Copyright 2020 Base4 Sistemas Ltda ME # diff --git a/setup.py b/setup.py index 4425ca3..a3edfde 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ def read(*filenames, **kwargs): def read_version(): - content = read(os.path.join('escpos', '__init__.py')) + content = read(os.path.join('pyescpos', '__init__.py')) return re.search(r"__version__ = '([^']+)'", content).group(1) @@ -62,9 +62,9 @@ def read_version(): long_description=long_description, long_description_content_type='text/x-rst', packages=[ - 'escpos', - 'escpos.impl', - 'escpos.conn', + 'pyescpos', + 'pyescpos.impl', + 'pyescpos.conn', ], install_requires=install_requires, extras_require=extras_require, diff --git a/tests/__init__.py b/tests/__init__.py index 72ac566..7c0cd18 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/__init__.py +# pyescpos/tests/__init__.py # # Copyright 2015 Base4 Sistemas Ltda ME # diff --git a/tests/conftest.py b/tests/conftest.py index 884f522..4e6151b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/conftest.py +# pyescpos/tests/conftest.py # # Copyright 2015 Base4 Sistemas Ltda ME # @@ -22,7 +22,7 @@ import pytest -from escpos import constants +from pyescpos import constants class FakeDevice(object): diff --git a/tests/test_asc.py b/tests/test_asc.py index 3577559..f428494 100644 --- a/tests/test_asc.py +++ b/tests/test_asc.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/test_asc.py +# pyescpos/tests/test_asc.py # # Copyright 2015 Base4 Sistemas Ltda ME # @@ -22,7 +22,7 @@ import pytest -from escpos import asc +from pyescpos import asc def test_mnemonic(): diff --git a/tests/test_bematech.py b/tests/test_bematech.py index 163dd04..0426d4d 100644 --- a/tests/test_bematech.py +++ b/tests/test_bematech.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/test_bematech.py +# pyescpos/tests/test_bematech.py # # Copyright 2015 Base4 Sistemas Ltda ME # @@ -24,11 +24,11 @@ import six -from escpos import feature -from escpos.barcode import BARCODE_NORMAL_WIDTH -from escpos.barcode import BARCODE_HRI_BOTTOM -from escpos.exceptions import CashDrawerException -from escpos.impl.bematech import MP4200TH +from pyescpos import feature +from pyescpos.barcode import BARCODE_NORMAL_WIDTH +from pyescpos.barcode import BARCODE_HRI_BOTTOM +from pyescpos.exceptions import CashDrawerException +from pyescpos.impl.bematech import MP4200TH # TODO: Implement tests for inherited methods so we can detect when changes # in the base implementation are potentially breaking the specific diff --git a/tests/test_conn_bt.py b/tests/test_conn_bt.py index ceb792b..3e2b2df 100644 --- a/tests/test_conn_bt.py +++ b/tests/test_conn_bt.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/test_conn_bt.py +# pyescpos/tests/test_conn_bt.py # # Copyright 2018 Base4 Sistemas Ltda ME # @@ -28,9 +28,9 @@ except ImportError: _lib_bluetooth = False -from escpos.conn.bt import find_rfcomm_port -from escpos.conn.bt import BluetoothPortDiscoveryError -from escpos.conn.bt import BluetoothConnection +from pyescpos.conn.bt import find_rfcomm_port +from pyescpos.conn.bt import BluetoothPortDiscoveryError +from pyescpos.conn.bt import BluetoothConnection class FakeBluetoothSocket(object): diff --git a/tests/test_conn_dummy.py b/tests/test_conn_dummy.py index 4d2153d..99dffd6 100644 --- a/tests/test_conn_dummy.py +++ b/tests/test_conn_dummy.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/test_conn_dummy.py +# pyescpos/tests/test_conn_dummy.py # # Copyright 2020 Base4 Sistemas EIRELI # @@ -21,7 +21,7 @@ from __future__ import unicode_literals -from escpos.conn.dummy import DummyConnection +from pyescpos.conn.dummy import DummyConnection def test_has_settings_example_attribute(): diff --git a/tests/test_conn_file.py b/tests/test_conn_file.py index 9060fa2..1a90abd 100644 --- a/tests/test_conn_file.py +++ b/tests/test_conn_file.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/test_conn_file.py +# pyescpos/tests/test_conn_file.py # # Copyright 2020 Base4 Sistemas EIRELI # @@ -21,7 +21,7 @@ from __future__ import unicode_literals -from escpos.conn.file import FileConnection +from pyescpos.conn.file import FileConnection def test_has_settings_example_attribute(): diff --git a/tests/test_conn_network.py b/tests/test_conn_network.py index dba01d1..c893fc5 100644 --- a/tests/test_conn_network.py +++ b/tests/test_conn_network.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/test_conn_network.py +# pyescpos/tests/test_conn_network.py # # Copyright 2020 Base4 Sistemas EIRELI # @@ -21,7 +21,7 @@ from __future__ import unicode_literals -from escpos.conn.network import NetworkConnection +from pyescpos.conn.network import NetworkConnection def test_has_settings_example_attribute(): diff --git a/tests/test_conn_serial.py b/tests/test_conn_serial.py index ac21616..500c4f7 100644 --- a/tests/test_conn_serial.py +++ b/tests/test_conn_serial.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/test_conn_serial.py +# pyescpos/tests/test_conn_serial.py # # Copyright 2020 Base4 Sistemas EIRELI # @@ -21,7 +21,7 @@ from __future__ import unicode_literals -from escpos.conn.serial import SerialConnection +from pyescpos.conn.serial import SerialConnection def test_has_settings_example_attribute(): diff --git a/tests/test_conn_usb.py b/tests/test_conn_usb.py index 08915f9..75840d6 100644 --- a/tests/test_conn_usb.py +++ b/tests/test_conn_usb.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/test_conn_usb.py +# pyescpos/tests/test_conn_usb.py # # Copyright 2020 Base4 Sistemas EIRELI # @@ -21,7 +21,7 @@ from __future__ import unicode_literals -from escpos.conn.usb import USBConnection +from pyescpos.conn.usb import USBConnection def test_has_settings_example_attribute(): diff --git a/tests/test_controlid_printidtouch.py b/tests/test_controlid_printidtouch.py index f261d9c..2eccd10 100644 --- a/tests/test_controlid_printidtouch.py +++ b/tests/test_controlid_printidtouch.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/test_controlid_printidtouch.py +# pyescpos/tests/test_controlid_printidtouch.py # # Copyright 2015 Base4 Sistemas Ltda ME # @@ -22,7 +22,7 @@ import pytest -from escpos.impl.controlid import PrintIdTouch +from pyescpos.impl.controlid import PrintIdTouch @pytest.fixture(scope='module') diff --git a/tests/test_daruma_darumageneric.py b/tests/test_daruma_darumageneric.py index ec91d14..485b261 100644 --- a/tests/test_daruma_darumageneric.py +++ b/tests/test_daruma_darumageneric.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/test_daruma_genericdaruma.py +# pyescpos/tests/test_daruma_genericdaruma.py # # Copyright 2015 Base4 Sistemas Ltda ME # @@ -22,7 +22,7 @@ import pytest -from escpos.impl.daruma import DarumaGeneric +from pyescpos.impl.daruma import DarumaGeneric @pytest.fixture(scope='module') diff --git a/tests/test_daruma_dr700.py b/tests/test_daruma_dr700.py index e2a8af6..18500e9 100644 --- a/tests/test_daruma_dr700.py +++ b/tests/test_daruma_dr700.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/test_daruma_dr700.py +# pyescpos/tests/test_daruma_dr700.py # # Copyright 2015 Base4 Sistemas Ltda ME # @@ -22,7 +22,7 @@ import pytest -from escpos.impl.daruma import DR700 +from pyescpos.impl.daruma import DR700 @pytest.fixture(scope='module') diff --git a/tests/test_elgin_elgingeneric.py b/tests/test_elgin_elgingeneric.py index 7f7d0f4..2199f13 100644 --- a/tests/test_elgin_elgingeneric.py +++ b/tests/test_elgin_elgingeneric.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/test_elgin_elgingeneric.py +# pyescpos/tests/test_elgin_elgingeneric.py # # Copyright 2015 Base4 Sistemas Ltda ME # @@ -22,7 +22,7 @@ import pytest -from escpos.impl.elgin import ElginGeneric +from pyescpos.impl.elgin import ElginGeneric @pytest.fixture(scope='module') diff --git a/tests/test_elgin_i7.py b/tests/test_elgin_i7.py index a378e78..420eb17 100644 --- a/tests/test_elgin_i7.py +++ b/tests/test_elgin_i7.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/test_elgin_i7.py +# pyescpos/tests/test_elgin_i7.py # # Copyright 2015 Base4 Sistemas Ltda ME # @@ -22,7 +22,7 @@ import pytest -from escpos.impl.elgin import ElginI7 +from pyescpos.impl.elgin import ElginI7 @pytest.fixture(scope='module') diff --git a/tests/test_elgin_i9.py b/tests/test_elgin_i9.py index bebfadd..5d3f566 100644 --- a/tests/test_elgin_i9.py +++ b/tests/test_elgin_i9.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/test_elgin_i9.py +# pyescpos/tests/test_elgin_i9.py # # Copyright 2015 Base4 Sistemas Ltda ME # @@ -22,8 +22,8 @@ import pytest -from escpos.exceptions import CashDrawerException -from escpos.impl.elgin import ElginI9 +from pyescpos.exceptions import CashDrawerException +from pyescpos.impl.elgin import ElginI9 @pytest.fixture(scope='module') diff --git a/tests/test_epson_genericescpos.py b/tests/test_epson_genericescpos.py index 24653ee..5b3ab34 100644 --- a/tests/test_epson_genericescpos.py +++ b/tests/test_epson_genericescpos.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/test_epson_genericescpos.py +# pyescpos/tests/test_epson_genericescpos.py # # Copyright 2015 Base4 Sistemas Ltda ME # @@ -22,8 +22,8 @@ import pytest -from escpos.impl.epson import GenericESCPOS -from escpos import feature +from pyescpos.impl.epson import GenericESCPOS +from pyescpos import feature @pytest.fixture(scope='module') diff --git a/tests/test_epson_tmt20.py b/tests/test_epson_tmt20.py index 25ab612..a96cdea 100644 --- a/tests/test_epson_tmt20.py +++ b/tests/test_epson_tmt20.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/test_epson_tmt20.py +# pyescpos/tests/test_epson_tmt20.py # # Copyright 2015 Base4 Sistemas Ltda ME # @@ -22,7 +22,7 @@ import pytest -from escpos.impl.epson import TMT20 +from pyescpos.impl.epson import TMT20 @pytest.fixture(scope='module') diff --git a/tests/test_helpers.py b/tests/test_helpers.py index 51c57f1..a260358 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/test_helpers.py +# pyescpos/tests/test_helpers.py # # Copyright 2015 Base4 Sistemas Ltda ME # @@ -23,10 +23,10 @@ import time import pytest -from escpos.exceptions import TimeoutException -from escpos.helpers import chunks -from escpos.helpers import TimeoutHelper -from escpos.helpers import find_implementations +from pyescpos.exceptions import TimeoutException +from pyescpos.helpers import chunks +from pyescpos.helpers import TimeoutHelper +from pyescpos.helpers import find_implementations def test_chunk(): @@ -52,7 +52,7 @@ def test_find_implementations(): assert isinstance(impls, tuple) assert len(impls) >= 1 - expected_fqname = 'escpos.impl.epson.GenericESCPOS' + expected_fqname = 'pyescpos.impl.epson.GenericESCPOS' for impl in impls: if impl.fqname == expected_fqname: diff --git a/tests/test_nitere_npdv1020.py b/tests/test_nitere_npdv1020.py index 73ff900..5e84716 100644 --- a/tests/test_nitere_npdv1020.py +++ b/tests/test_nitere_npdv1020.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/test_nitere_npdv1020.py +# pyescpos/tests/test_nitere_npdv1020.py # # Copyright 2015 Base4 Sistemas Ltda ME # @@ -22,7 +22,7 @@ import pytest -from escpos.impl.nitere import NitereNPDV1020 +from pyescpos.impl.nitere import NitereNPDV1020 @pytest.fixture(scope='module') diff --git a/tests/test_retry.py b/tests/test_retry.py index 998cef7..4088175 100644 --- a/tests/test_retry.py +++ b/tests/test_retry.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/test_retry.py +# pyescpos/tests/test_retry.py # # Copyright 2021 Base4 Sistemas EIRELI # @@ -24,8 +24,8 @@ import pytest -from escpos.retry import time as time_module -from escpos.retry import backoff +from pyescpos.retry import time as time_module +from pyescpos.retry import backoff def test_backoff_no_exceptions_raised(): diff --git a/tests/test_unknown_cb55c.py b/tests/test_unknown_cb55c.py index 9f3ee8f..7d0e787 100644 --- a/tests/test_unknown_cb55c.py +++ b/tests/test_unknown_cb55c.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# escpos/tests/test_unknown_cb55c.py +# pyescpos/tests/test_unknown_cb55c.py # # Copyright 2015 Base4 Sistemas Ltda ME # @@ -22,7 +22,7 @@ import pytest -from escpos.impl.unknown import CB55C +from pyescpos.impl.unknown import CB55C @pytest.fixture(scope='module') From b9978364491ebb41225f6b6c535dc740c3be1ebb Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Fri, 12 Aug 2022 16:28:39 -0300 Subject: [PATCH 2/2] [NEW] Bumpversion 0.4 -> 0.5 Signed-off-by: Luis Felipe Mileo --- pyescpos/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyescpos/__init__.py b/pyescpos/__init__.py index aa0e66a..d413f59 100644 --- a/pyescpos/__init__.py +++ b/pyescpos/__init__.py @@ -23,7 +23,7 @@ import logging -__version__ = '0.4' +__version__ = '0.5' logging.getLogger('pyescpos').addHandler(logging.NullHandler())