Commit Graph

12 Commits

Author SHA1 Message Date
Patrick Kanzler 815f247df1
Improve test coverage and fix issue in path loading (#602)
* reactivate skipped tests

* remove unused internal interfaces

* enable pytest in VS Code

* simplify and fix path logic in loader

* increase test coverage

* test missing config

* check for wrong printer names

* Skipped appdir test
2023-12-06 00:25:36 +01:00
Patrick Kanzler 4c2dcdfac6
Clean up tests and migrate (#540)
* 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
2023-08-10 00:18:02 +02:00
Patrick Kanzler 435f2bba24 reformat codebase 2021-10-30 18:15:22 +02:00
Romain Porte cb30d7a881 drop Python 2.7 support
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>
2020-05-10 10:55:44 +02:00
Patrick Kanzler 0c9856c1f6
disable QR test for image 2018-05-13 18:26:48 +02:00
Romain Porte b648cfd67f First attempt at centering images and QRs (#250)
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
2017-08-31 09:25:35 +02:00
Romain Porte 5bd6dcf471 Ensure QR codes have a border large enough (#235)
*  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
2017-07-24 15:04:54 +02:00
Patrick Kanzler 3ee787e8b1
change license to MIT 2017-01-31 03:55:50 +01:00
Michael Billington a0d8689141 apply fixes, mainly to whitespace ( patch by @patkan in #128 ) 2016-04-13 21:27:51 +10:00
Michael Billington 4584e3138a switch default image format to bitImageRaster
Printers which don't have native QR rendering are less likely to support the newer GS ( L graphics command.
2016-04-06 21:39:46 +10:00
Michael Billington b45afbb297 add implementation of GS v 0, GS ( L and GS *.
- ported test cases for EscposImage class, copied over 1px and 2px test images from escpos-php
- added test cases over image print function
- updated QR tests to also include image output check
- updated CLI to match new image function options
2016-04-06 07:34:19 +10:00
Michael Billington f39c4227ec Implement printer-side rendering of QR codes for printers that support it.
Expand settings on escpos.qr to include ec, size,
model and 'native' (send image or send esc/pos QR command).

Default is set as native=False, so existing code will continue to
render QR codes as images.
2016-04-03 13:55:52 +10:00