commit
0524b0576e
|
@ -18,6 +18,7 @@ build/
|
||||||
dist/
|
dist/
|
||||||
.coverage
|
.coverage
|
||||||
src/escpos/version.py
|
src/escpos/version.py
|
||||||
|
.hypothesis
|
||||||
|
|
||||||
# testing temporary directories
|
# testing temporary directories
|
||||||
test/test-cli-output/
|
test/test-cli-output/
|
||||||
|
|
|
@ -28,6 +28,7 @@ matrix:
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- python: 3.5-dev
|
- python: 3.5-dev
|
||||||
- python: nightly
|
- python: nightly
|
||||||
|
- python: pypy3
|
||||||
before_install:
|
before_install:
|
||||||
- pip install tox codecov
|
- pip install tox codecov
|
||||||
script:
|
script:
|
||||||
|
|
|
@ -2,6 +2,19 @@
|
||||||
Changelog
|
Changelog
|
||||||
*********
|
*********
|
||||||
|
|
||||||
|
2016-??-?? - Version 2.1.? - "Contents May Differ"
|
||||||
|
--------------------------------------------------
|
||||||
|
|
||||||
|
changes
|
||||||
|
^^^^^^^
|
||||||
|
- rename variable interface in USB-class to timeout
|
||||||
|
- add support for hypothesis and move pypy3 to the allowed failures (pypy3 is not supported by hypothesis)
|
||||||
|
|
||||||
|
contributors
|
||||||
|
^^^^^^^^^^^^
|
||||||
|
- Patrick Kanzler
|
||||||
|
- Renato Lorenzi
|
||||||
|
|
||||||
2016-07-23 - Version 2.1.0 - "But Who's Counting?"
|
2016-07-23 - Version 2.1.0 - "But Who's Counting?"
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
|
|
||||||
|
|
12
codecov.yml
12
codecov.yml
|
@ -1,4 +1,16 @@
|
||||||
|
codecov:
|
||||||
|
bot: patkan
|
||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
|
status:
|
||||||
|
project:
|
||||||
|
default: # status context
|
||||||
|
target: auto
|
||||||
|
threshold: "1%"
|
||||||
|
patch:
|
||||||
|
default:
|
||||||
|
target: auto
|
||||||
|
threshold: "1%"
|
||||||
range: "60...100"
|
range: "60...100"
|
||||||
|
|
||||||
comment: off
|
comment: off
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -116,7 +116,7 @@ setup(
|
||||||
setup_requires=[
|
setup_requires=[
|
||||||
'setuptools_scm',
|
'setuptools_scm',
|
||||||
],
|
],
|
||||||
tests_require=['tox', 'nose', 'scripttest'],
|
tests_require=['tox', 'nose', 'scripttest', 'mock', 'hypothesis'],
|
||||||
cmdclass={'test': Tox},
|
cmdclass={'test': Tox},
|
||||||
entry_points={
|
entry_points={
|
||||||
'console_scripts': [
|
'console_scripts': [
|
||||||
|
|
|
@ -34,18 +34,18 @@ class Usb(Escpos):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, idVendor, idProduct, interface=0, in_ep=0x82, out_ep=0x01, *args, **kwargs):
|
def __init__(self, idVendor, idProduct, timeout=0, in_ep=0x82, out_ep=0x01, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
:param idVendor: Vendor ID
|
:param idVendor: Vendor ID
|
||||||
:param idProduct: Product ID
|
:param idProduct: Product ID
|
||||||
:param interface: USB device interface
|
:param timeout: Is the time limit of the USB operation. Default without timeout.
|
||||||
:param in_ep: Input end point
|
:param in_ep: Input end point
|
||||||
:param out_ep: Output end point
|
:param out_ep: Output end point
|
||||||
"""
|
"""
|
||||||
Escpos.__init__(self, *args, **kwargs)
|
Escpos.__init__(self, *args, **kwargs)
|
||||||
self.idVendor = idVendor
|
self.idVendor = idVendor
|
||||||
self.idProduct = idProduct
|
self.idProduct = idProduct
|
||||||
self.interface = interface
|
self.timeout = timeout
|
||||||
self.in_ep = in_ep
|
self.in_ep = in_ep
|
||||||
self.out_ep = out_ep
|
self.out_ep = out_ep
|
||||||
self.open()
|
self.open()
|
||||||
|
@ -82,7 +82,7 @@ class Usb(Escpos):
|
||||||
:param msg: arbitrary code to be printed
|
:param msg: arbitrary code to be printed
|
||||||
:type msg: bytes
|
:type msg: bytes
|
||||||
"""
|
"""
|
||||||
self.device.write(self.out_ep, msg, self.interface)
|
self.device.write(self.out_ep, msg, self.timeout)
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
""" Release USB interface """
|
""" Release USB interface """
|
||||||
|
|
2
tox.ini
2
tox.ini
|
@ -5,6 +5,8 @@ envlist = py27, py34, py35, docs
|
||||||
deps = nose
|
deps = nose
|
||||||
coverage
|
coverage
|
||||||
scripttest
|
scripttest
|
||||||
|
mock
|
||||||
|
hypothesis
|
||||||
commands = nosetests --with-coverage --cover-erase --cover-branches
|
commands = nosetests --with-coverage --cover-erase --cover-branches
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
|
|
Loading…
Reference in New Issue