Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] Rename escpos folder to pyescpos #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)
Expand All @@ -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')
Expand All @@ -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')
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions escpos/__init__.py → pyescpos/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# escpos/__init__.py
# pyescpos/__init__.py
#
# Copyright 2015 Base4 Sistemas Ltda ME
#
Expand All @@ -23,9 +23,9 @@
import logging


__version__ = '0.4'
__version__ = '0.5'

logging.getLogger('escpos').addHandler(logging.NullHandler())
logging.getLogger('pyescpos').addHandler(logging.NullHandler())


from .conn import * # noqa: E402,F401,F403
2 changes: 1 addition & 1 deletion escpos/asc.py → pyescpos/asc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# escpos/asc.py
# pyescpos/asc.py
#
# Copyright 2015 Base4 Sistemas Ltda ME
#
Expand Down
2 changes: 1 addition & 1 deletion escpos/barcode.py → pyescpos/barcode.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# escpos/barcode.py
# pyescpos/barcode.py
#
# Copyright 2015 Base4 Sistemas Ltda ME
#
Expand Down
2 changes: 1 addition & 1 deletion escpos/config.py → pyescpos/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# escpos/config.py
# pyescpos/config.py
#
# Copyright 2018 Base4 Sistemas Ltda ME
#
Expand Down
14 changes: 7 additions & 7 deletions escpos/conn/__init__.py → pyescpos/conn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# escpos/conn/__init__.py
# pyescpos/conn/__init__.py
#
# Copyright 2018 Base4 Sistemas Ltda ME
#
Expand Down Expand Up @@ -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."""
6 changes: 3 additions & 3 deletions escpos/conn/bt.py → pyescpos/conn/bt.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from ..retry import backoff


logger = logging.getLogger('escpos.conn.bt')
logger = logging.getLogger('pyescpos.conn.bt')


class BluetoothConnectionError(Exception):
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions escpos/conn/dummy.py → pyescpos/conn/dummy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# escpos/conn/dummy.py
# pyescpos/conn/dummy.py
#
# Copyright 2017 KMEE INFORMATICA LTDA
#
Expand All @@ -25,7 +25,7 @@
from ..helpers import hexdump


logger = logging.getLogger('escpos.conn.dummy')
logger = logging.getLogger('pyescpos.conn.dummy')


class DummyConnection(object):
Expand Down
4 changes: 2 additions & 2 deletions escpos/conn/file.py → pyescpos/conn/file.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# escpos/conn/file.py
# pyescpos/conn/file.py
#
# Copyright 2017 KMEE INFORMATICA LTDA
#
Expand All @@ -27,7 +27,7 @@
from ..helpers import hexdump


logger = logging.getLogger('escpos.conn.file')
logger = logging.getLogger('pyescpos.conn.file')


@python_2_unicode_compatible
Expand Down
4 changes: 2 additions & 2 deletions escpos/conn/network.py → pyescpos/conn/network.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# escpos/conn/network.py
# pyescpos/conn/network.py
#
# Copyright 2015 Base4 Sistemas Ltda ME
#
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions escpos/conn/serial.py → pyescpos/conn/serial.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# escpos/conn/serial.py
# pyescpos/conn/serial.py
#
# Copyright 2015 Base4 Sistemas Ltda ME
#
Expand Down Expand Up @@ -54,7 +54,7 @@
)


logger = logging.getLogger('escpos.conn.serial')
logger = logging.getLogger('pyescpos.conn.serial')


def depends_on_pyserial_lib(func):
Expand Down
4 changes: 2 additions & 2 deletions escpos/conn/usb.py → pyescpos/conn/usb.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# escpos/usb.py
# pyescpos/usb.py
#
# Copyright 2017 Base4 Sistemas Ltda ME
#
Expand Down Expand Up @@ -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):
Expand Down
10 changes: 5 additions & 5 deletions escpos/constants.py → pyescpos/constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# escpos/constants.py
# pyescpos/constants.py
#
# Copyright 2015 Base4 Sistemas Ltda ME
#
Expand All @@ -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`.
"""
2 changes: 1 addition & 1 deletion escpos/exceptions.py → pyescpos/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# escpos/exceptions.py
# pyescpos/exceptions.py
#
# Copyright 2015 Base4 Sistemas Ltda ME
#
Expand Down
2 changes: 1 addition & 1 deletion escpos/feature.py → pyescpos/feature.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# escpos/feature.py
# pyescpos/feature.py
#
# Copyright 2015 Base4 Sistemas Ltda ME
#
Expand Down
6 changes: 3 additions & 3 deletions escpos/helpers.py → pyescpos/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)


Expand Down
2 changes: 1 addition & 1 deletion escpos/impl/__init__.py → pyescpos/impl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# escpos/impl/__init__.py
# pyescpos/impl/__init__.py
#
# Copyright 2015 Base4 Sistemas Ltda ME
#
Expand Down
2 changes: 1 addition & 1 deletion escpos/impl/bematech.py → pyescpos/impl/bematech.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# escpos/impl/bematech.py
# pyescpos/impl/bematech.py
#
# Copyright 2015 Base4 Sistemas Ltda ME
#
Expand Down
2 changes: 1 addition & 1 deletion escpos/impl/controlid.py → pyescpos/impl/controlid.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# escpos/impl/controlid.py
# pyescpos/impl/controlid.py
#
# Copyright 2021 Base4 Sistemas
#
Expand Down
2 changes: 1 addition & 1 deletion escpos/impl/daruma.py → pyescpos/impl/daruma.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# escpos/impl/daruma.py
# pyescpos/impl/daruma.py
#
# Copyright 2015 Base4 Sistemas Ltda ME
#
Expand Down
2 changes: 1 addition & 1 deletion escpos/impl/elgin.py → pyescpos/impl/elgin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# escpos/impl/elgin.py
# pyescpos/impl/elgin.py
#
# Copyright 2015 Base4 Sistemas Ltda ME
#
Expand Down
Loading