Commit Graph

849 Commits

Author SHA1 Message Date
Patrick Kanzler 1439b14686
tell sort to ignore case 2017-08-31 13:43:07 +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
Sergio 50c627fbb0 Pickling capabilities for faster start up times. (#252)
On a RaspberryPi it's taking 10 seconds to simply run:

import escpos.printer

This change creates a pickle file that will load 20x faster. The
rationale is that the capabilities.json file doesn't change too often.

Also changed some imports for PEP8.
2017-08-31 09:07:26 +02:00
Sergio Pulgarin 99034d0575 Fixed outdated example file: should be font 'b' not 'B'
Updated AUTHORS using script.
2017-08-31 08:38:32 +02:00
Patrick Kanzler 19663ec574 fix cut function in example 2017-08-10 21:54:52 +02:00
Patrick Kanzler 281eea125f fix abstract read-function
read does not need msg-parameter
2017-08-10 21:51:51 +02:00
Patrick Kanzler 5bed0bfbb4
fix name of pyyaml for PyPi 2017-08-09 10:41:25 +02:00
Patrick Kanzler f12470d3cd update contributing 2017-08-08 13:37:30 +02:00
Patrick Kanzler fb0e4c28ba update README 2017-08-08 13:30:16 +02:00
Patrick Kanzler af29fcca77 alpha release v3.0a2 2017-08-04 16:48:36 +02:00
Patrick Kanzler f8b269d859
update changelog for next release 2017-08-04 16:30:31 +02:00
Patrick Kanzler c259263f26 blacklist pytest 3.2.0 because it breaks our tests
see pytest-dev/pytest#2644 for reference
2017-08-04 15:17:05 +02:00
Patrick Kanzler 27c843935f add viivakoodi to dep in tox-file 2017-08-04 15:17:05 +02:00
Patrick Kanzler f3da6a9725 remove quanitifed-code-badge 2017-08-01 17:42:34 +02:00
Romain Porte b64b534394 Add methods for simpler newlines (#246) 2017-08-01 17:09:24 +02:00
Patrick Kanzler 81426ab6dc fix whitespace 2017-08-01 12:27:53 +02:00
Patrick Kanzler df1193ab35 implement read for Serial 2017-08-01 11:20:00 +02:00
mrwunderbar666 b494c9a4bd Weather Forecast Example Script (#239)
* 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
2017-08-01 11:13:45 +02:00
Patrick Kanzler f8a2174108 fix typo 2017-07-27 23:06:59 +02:00
csoft2k 1f57b04974 Paper sensor querying command (#242)
The DLE EOT command allows querying the status of several features of
the printer.
Added to the online/offline status developed in #237, this commit adds a
paper sensor querying.

Tested with an Epson TM-T20II, which only has an end-paper sensor. The
near-end paper sensor should be tested with a compatible printer.
However, the implementation is quite straight-forward.
2017-07-27 23:05:50 +02:00
Romain Porte c7080165a7 Added test script for hard and soft barcodes (#243) 2017-07-27 22:45:51 +02:00
Patrick Kanzler cf0cf127fe
add changelog for next release 2017-07-27 16:50:41 +02:00
csoft2k 82c67aa646 Fix tabs behaviour (#238)
The changes done in this commit should help with the open issues:
#5, #27 and #161.
The old implementation lacked the NUL char at the end of the command, as
defined on the Epson ESC/POS Reference Guide (see
https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=53
). Also, the horizontal tab control character (CTL_HT) shouldn't be
there.

This implementation allows setting up to 32 tabs with a given tab width.
Both values are checked to be in the valid ranges defined on the guide.
Also, the TabPosError exception text has been rewritten to define the
stated above.
2017-07-26 10:01:08 +02:00
Romain Porte 9e47ff2505 Added test for cut without feed, fixed raw code for it 2017-07-26 09:09:32 +02:00
Romain Porte 9bc3b30a60 Optional feed for cut (closes #213) 2017-07-26 09:09:32 +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
csoft2k 89dfb6cf86 Added the DLE EOT querying command. (#237)
* Added the DLE EOT querying command.
Added a function to check whether the printer is online or not, as well
as a reading method for USB printers.
* Update AUTHORS
* Add entry to .mailmap
* currently USB only
2017-07-24 13:57:02 +02:00
Patrick Kanzler 662aa30f4b Update readme list of dependencies
add viivakoodi and links
2017-06-22 15:54:21 +02:00
TAHRI Ahmed efec3e508c Fix SerialException when trying to close device on __del__ without verifing if is actually opened. 2017-06-19 13:42:46 +02:00
Patrick Kanzler c3e952befa
cat authorsfiles during check 2017-06-19 11:15:04 +00:00
Patrick Kanzler 83b426f5fd Merge pull request #222 from MicroJoe/software-barcode
First implementation of software barcode
2017-06-19 12:57:05 +02:00
Romain Porte b963c5668b Using viivakoodi instead of pyBarcode 2017-06-11 10:06:57 +02:00
Patrick Kanzler 4882c31531 Clarifiy and update usage.rst
relevant to #230
clarifies the config-file  in the usage.rst
2017-06-10 23:35:26 +00:00
Patrick Kanzler 7c17141fb2
integrate author check into travis 2017-05-26 02:36:16 +02:00
Romain Porte 3f9d44ff15 Added authors file and generate_authors.sh (#227)
* Added authors file

Generated using `git shortlog -s -n` and sorted by alphabetical order
using vim.

* Added generate_authors.sh script and ordered author list

* Regenerated AUTHORS with .mailmap
2017-05-26 00:27:17 +02:00
Romain Porte a069009696 Lists should not be right-espaced in reST 2017-05-24 23:57:38 +02:00
Patrick Kanzler 024b0df7d2
added new trove for 3.6 and 3.7 2017-05-24 10:58:55 +02:00
Patrick Kanzler 74ef9aed7f
add .mailmap in order to normalize shortlog 2017-05-24 10:23:01 +02:00
Romain Porte c4dd4f2960 Added ImageWidthError and its implementation (#226)
* Added ImageWidthError and its implementation

* Added unit tests for ImageWidthError

* Parse max_width to int before compare
2017-05-23 15:13:28 +02:00
Romain Porte d348712439 PEP8 software barcode example 2017-05-22 20:25:51 +02:00
Romain Porte 22cf6ad00b Allow users to change impl for soft_barcode 2017-05-22 20:21:35 +02:00
Patrick Kanzler 5bf2636753 rewrite to Dummy() 2017-05-22 00:57:48 +02:00
TAHRI Ahmed 1f427953a8 Preliminary support of pos 'line display' printing 2017-05-22 00:40:40 +02:00
Romain Porte a6e1d0df00 Using booleans for handling text size 2017-05-21 22:50:07 +02:00
Romain Porte c0b4d03692 Updated documentation of set method 2017-05-21 22:50:07 +02:00
Romain Porte a16d6bde06 Refactor of the set method, with tests 2017-05-21 22:50:07 +02:00
Romain Porte 737cc3176e First implementation of software barcode
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.
2017-05-16 20:56:27 +02:00
Romain Porte 4b04a5c425 Fixed bad format of :code: in documentation 2017-05-14 21:33:43 +02:00
Patrick Kanzler df33945458 Release v3.0a1 (#209 from python-escpos/development)
Release v3.0a1
2017-03-29 16:02:10 +02:00
Patrick Kanzler c1a7d71fd7
update changelog 2017-03-29 15:45:06 +02:00