* remove type comment where type is annotated
* move function tests
* remove six from tests
* add none annotations
* add more types
* change mock (so that mypy understands it)
* fix unfinished Python2 -> 3 translation
* remove some six usage
* annotate
* fix regression in Six removal
* mypy: self.enf is always defined
* fix return type of cups.py
* Usb idVendor/idProduct are integers
* self.default_args is always defined
* tweak usb_args, PEP589 is better
* lp.py: reassure mypy
* correctly cast call to CashDrawerError()
* update CUPS test
* add missing close() method in metaclass
* document a bug in typeshed
* query_status() returns bytes as seen in constants.py
* remove more SIX usage
* test examples too
* remove type comment where type is annotated
* adapt behavior of cups printer to match other implementations
---------
Co-authored-by: Patrick Kanzler <dev@pkanzler.de>
Co-authored-by: Patrick Kanzler <4189642+patkan@users.noreply.github.com>
* Add fixtures
* Add test_printer_file.py
* Remove old broken printer tests
* Include a close_on_reopen test
* Add test_printer_network.py
* Add test_printer_serial.py
* Add test_printer_usb.py
* Add test_printer_lp.py
* Add test_printer_cups.py
* Add test_printer_win32raw.py
* Test the 'printers' property
* Fix conftest import formatting
* Fix failing LP tests
* Cancel close only if literal False|None _device
* Fix win32raw failing tests (maybe)
* Include win32raw close_on_reopen test
* Include test _raw methods to win32raw
* Replace general exceptions in win32raw
* Replace wrong exception in cups
* Include more tests to cups
* Extend cups tests
* add unit test for issue pointed out by @scott-r in #570
* swap order of encoder search
As described by @scott-r in
Magic encoder does not use
previously used code pages
when possible #570
Thank you!
* add type annotations
* Update setup.cfg
* improve mypy and test config
* get_profile_class returns a baseProfile
* mute mypy type issue
* add set_with_default
* docstring
* add test for empty call
* correct type annotations in set_with_default
* improve tests
* test for exception
* sort with isort
* add default value to get call
* empty string has the same effect: will not be found --> None
* add mypy test to workflow
* explicitely call mypy
* update spelling
* add inheritance diagrams to all printers and exceptions
* split off printer implementations into separate files
* add wrapper that thros RuntimeError if not importable
* add dependency check for lp
* add dependency check for pyserial
* added check for usability
* import Win32Raw
* include WIn32Raw in documentation
* enable all extras on tox
* update github workflow
Drops Py3.7, improves typing and adds a mypy config, improves the docstrings and isorts the imports.
* configure isort
* sort with isort
* add github action
* enable flake8-docstrings
* fix docstrings
* add mypy env
* no implicit optional
* add type for raw
* add some type hints
* migrate
* abstract base class test
* remove assert_equal in test_cli
* remove nose from test_cli
* remove nose dependencies
* use tempfile
* configure coverage
* flag python version in name
* enable comment
* drop EOL py37
* Add buzzer function
* Add `buzzer(time, duration)` function to control the buzzer on supported
printers.
* Add unit tests for buzzer function.
* Update test_function_buzzer.py to pass black
* Run black in tests files
---------
Co-authored-by: Patrick Kanzler <dev@pkanzler.de>
* break line
* remove unused imports
* remove unused os import
* make flake8 more strict
* configure flake for black
* fix action
* use importlib_resources
* rename deprecated methods
* Merge software and hardware barcodes to one method
* Fix wrong sw barcode heigh/width
* Add missing param to _sw_barcode call
* Make barcode() smarter, improvements and clean up
* Use param font_size in sw_barcode()
* Update docstrings
* Update barcode examples and docs
* Add --force_software option to CLI
* Attempt to match the sw and hw barcode sizes
* Better approximation to native font size
* Fix docs build
* Update tests at test_function_softbarcode
* Fix exception
* Move image dpi setting to writter_options
* Fix _sw_barcode() docstring param
* Fix wrong default param in docstring
* improve linkage in documentation
---------
Co-authored-by: Patrick Kanzler <4189642+patkan@users.noreply.github.com>
Co-authored-by: Patrick Kanzler <dev@pkanzler.de>
Python 2.7 EOL is arriving on 2020-01-01: https://pythonclock.org/
This will allow us to use Python 3 only libraries, like python-barcode,
which can maintain a reduced, simpler codebase, due to only one version
to support.
Closes#371.
Signed-off-by: Romain Porte <microjoe@microjoe.org>
Add Function to Dummy Printer for Clearing Buffer
If you are using the dummy printer, you may want to use the printer
again after sending the output to a physical printer.
This method empties the list of the output buffer.
* add a method to check barcode code format
ensure that the code to print is compatible with the ESC/POS formats and
also automatically check this format before printing (barcode() method).
* rewrite test using pytest's parametrize functionality
* add test for the 'check' argument
* update authors list
The feature use_coverage of hypothesis caused the failing tests, because
the printer_file_test is sensitive to the coverage analysis of
hypothesis.
Fixed by disabling use_coverage for the crashing tests
hypothesis introduced a regression in 3.29.0 (or at least changed
behaviour). Until I have found the problem I will pin it to the last
working version.
Also two tests should be prevented from failing when they are slow.
This was tested on ZJ-5890 with success. By default centering is
deactivated for backward compatibility. Trying to center a QR code in
native mode will raise an exception as we do not know ATM if the native
rendering is centered by default or not.
* Added basic tests for center feature
* Check image size before centering
* Ensure QR codes have a border large enough
(The QR code spec requires a border at least 4*box_size thick but we can't
just set border=16 because that results in a QR code more than 255px tall
and I'm not yet ready to use fullimage() as a backend for it)
This fix was originally commited by Stephan Sokolow on 2014-05-22
* Let the user print stuff using qr example
* fix tests