* 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>
* Added example with Docker and Flask
* set flask debug flag to False
* new line at the end of file
* format with black
---------
Co-authored-by: Ricardo Sanchez Alba <r2sanchezalba@gmail.com>
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>
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
* Example Weather forecast script
Used Adafruits example as base and adapted it for python-escpos
Weather icons taken from
http://adamwhitcroft.com/climacons/
* Weather Icons from Adam Whitcroft
Weather Icons from http://adamwhitcroft.com/climacons/
* update authors
* Minor improvements
* Weather Script Debugged
Added one more Icon
Attributed Icons in readme.md
changed folder structure
* Change formatting
* Fixed pathing to graphics issue
* fixed image size
* autopep8 to clean up the code
* 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
Actually the hardware barcode implementation is very specific and not
generic enough for just adding a `soft_render=True` argument to it. This
is a first work that can be improved with other commits, maybe for
merging this method in the `barcode` method after some cleanup.
The width, height and text_distance were set using empiric
print-and-retry tests so that the generated barcode looks nice to the
eye (and to the eye of an Android scanner tool.
!WARNING! Printing a barcode that is too large in width will result in
the printer to go crazy trying to print an image that is too large for
it. This may be fixed by raising an exception in the `image` method.