Commit Graph

106 Commits

Author SHA1 Message Date
aerialist f42410603d
Add sleep in sending fragments (#624)
* Add sleep in sending fragments

Adding sleep prevents "USBTimeoutError: [Errno 110] Operation timed out".

* change sorting

* make sleep configurable

* add spelling

---------

Co-authored-by: Patrick Kanzler <4189642+patkan@users.noreply.github.com>
Co-authored-by: Patrick Kanzler <dev@pkanzler.de>
2024-08-25 00:50:27 +02:00
Patrick Kanzler 0d22896689
Prepare release 3.1 (#614)
* update authors
* update changelog
* update spelling
* update black
2023-12-17 22:53:19 +01:00
Patrick Kanzler ac23c083b6
update to newest python-barcode (#595)
* update to newest python-barcode
2023-12-03 23:57:34 +01:00
dependabot[bot] 8274833255
Bump sphinx-rtd-theme from 1.3.0 to 2.0.0 (#596)
Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 1.3.0 to 2.0.0.
- [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst)
- [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/1.3.0...2.0.0)

---
updated-dependencies:
- dependency-name: sphinx-rtd-theme
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-30 08:38:40 +01:00
Patrick Kanzler a70e1604d6
Magic encoder: fix codepage usage (#580)
* 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!
2023-10-05 14:55:12 +02:00
Patrick Kanzler 5018f7f377
add checkpoint to release checklist for changelog (#578) 2023-10-05 14:22:21 +02:00
Patrick Kanzler ecfeeb9b13
Improve diagnostic output (#577)
* add extended version information

* autodocument argparser

* add spelling exception

* fix docstrings

* add annotations

* use typing types

* add test
2023-10-05 14:15:19 +02:00
Patrick Kanzler f3ee049ee1
Update spelling_wordlist.txt (#566)
* Update spelling_wordlist.txt

* update apt
2023-09-17 23:00:38 +02:00
Patrick Kanzler cfa9ecf16d
Enable spell checking (#563)
* add spellchecking

* improve spelling

* improve spelling config

* extend word list

* improve spelling

* improve spelling

* escalate warning in spell check to failure

* fix spelling

* fix spelling

* add plural

* Update doc/spelling_wordlist.txt

* do not stop on warning

* require newest sphinxcontrib spelling

* remove old comment

* add authors as single line entry to spelling list

* reenable stop on warning
2023-09-07 22:08:31 +02:00
Patrick Kanzler 24217756f7
558 improve capabilities handling (#562)
* add handling for missing capabilities file

* improve documentation

* Update doc/user/installation.rst
2023-09-06 00:05:38 +02:00
Patrick Kanzler c7c01cdbff
fix rtd theme (#553)
* use rtd_theme

* add types for serial

* annotate types where possible

* fix imports
2023-08-25 01:19:23 +02:00
dependabot[bot] 6c49e4a057
Bump sphinx-rtd-theme from 1.2.2 to 1.3.0 (#550) 2023-08-24 21:30:22 +00:00
Patrick Kanzler c11d192e65
Fix import issues with qrcode in sphinx 7.2 (#552)
* 7.2 introduces the issue

* mock module qrcode for documentation build

This prevents issues with sphinx 7.2
2023-08-24 23:02:33 +02:00
Patrick Kanzler 3177c8d411
split off dependencies for optional installation (#546)
* 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
2023-08-17 01:37:50 +02:00
Patrick Kanzler fbabd8ed88
Drop Py37, improve typing and docstrings (#544)
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
2023-08-15 01:03:36 +02:00
Patrick Kanzler 2b62c8e28d
modernize and cleanup documentation (#542)
* disable system packages on rtd

* install pycups on rtd

* enable cups binding in documentation

* document CupsPrinter

* fix formatting

* revise methods and installation

* revise user/printers

* revise raspi section

* further revise
2023-08-10 01:38:47 +02:00
Patrick Kanzler 31daabcbea
Improve documentation build (#539)
* use imgconverter
* enable pdf build with xelatex
* change heading levels
* restructure headings
* add chapter intro
* remove extensions from index
2023-08-09 00:52:01 +02:00
Patrick Kanzler 60c4f481ae
Add printer profile list to documentation (#536)
* add first draft of printer profile listing

* add todos

* Update doc/capability_templates/capabilities-template.jinja

* Update doc/capability_templates/capabilities-template.jinja

* restructure documentation

* add encoding list

* add color and encoding table

* add notes on usage

* add feature table
2023-07-29 02:02:13 +02:00
Patrick Kanzler 09a598883c
351 ean example fix (#537)
* bug/doc: Fix invalid EAN-13 barcode in examples

In the various examples and python-escpos CLI there are a number of uses
of `13243546557687` as an EAN-13 example.  This EAN barcode is invalid
as the checksum should be `0` and not `7`.

```
$ python test_print.py
Traceback (most recent call last):
  File "test_print.py", line 5, in <module>
    p.barcode('13243546557687', 'EAN13', 64, 2, '', '')
  File "/home/pi/fatt-display/lib/python3.7/site-packages/escpos/escpos.py", line 433, in barcode
    bc=bc,
escpos.exceptions.BarcodeCodeError: No Barcode code was supplied (Barcode '13243546557687' not in a valid format for type 'EAN13')
```

This patch set removes `13243546557687` and replaces it with the valid
number `40063813339310`.

In researching the list of [assigned prefixes issued by
G1][g1-prefixes] there seemed to be no "officially" defined test  prefix, so
this change was made to be minimally invasive using the number from the
existing test cases.

Resolves #350

Affects #176

[g1-prefixes]: https://www.gs1.org/standards/id-keys/company-prefix
[test-code]: https://www.barcodelookup.com/4006381333931

---------

Co-authored-by: Brian 'Redbeard' Harrington <redbeard@dead-city.org>
2023-07-28 18:23:18 +02:00
Patrick Kanzler e9e8b10582
Fixes from ci (#533)
* 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
2023-07-21 23:03:46 +02:00
Benito López 3c11c1b9ab
New high level barcode method. Closes #245, #244. (#527)
* 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>
2023-07-12 20:45:41 +02:00
dependabot[bot] 676d2840de
Bump sphinx-rtd-theme from 1.2.1 to 1.2.2 (#528)
Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 1.2.1 to 1.2.2.
- [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst)
- [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/1.2.1...1.2.2)

---
updated-dependencies:
- dependency-name: sphinx-rtd-theme
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-09 01:24:17 +02:00
dependabot[bot] c67c077a4d
Bump sphinx-rtd-theme from 1.2.0 to 1.2.1 (#524)
Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 1.2.0 to 1.2.1.
- [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst)
- [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/1.2.0...1.2.1)

---
updated-dependencies:
- dependency-name: sphinx-rtd-theme
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 15:22:50 +02:00
Patrick Kanzler 905e37e52e
update read the docs config (#520)
* update read the docs config

* add hints on black code style

* add link to black

* fix path to requirements

* include submodules in build

* add submodule capabilities-data

* format as list

* post on execution on RTD

* use sphinx rtd theme 1.2.0

* add apt dependencies
2023-05-18 16:33:20 +02:00
Patrick Kanzler 3560f8b12b
housekeeping: fix-build for doc (#515)
* disable git checkout head²

* update pull request template

* add importlib metadata to requirements for doc build

* update capabilities data
2023-05-11 23:12:46 +02:00
Patrick Kanzler 98ee06a783 preliminarily deactivate cups printer documentation 2023-04-19 22:42:55 +02:00
belono ea61f287cb Add/Improve documentation of the new connectors 2022-12-11 16:29:33 +01:00
belono 69e9dca761 Fix black linter checks - Remove u"" strings 2022-11-24 20:23:21 +01:00
Patrick Kanzler 5bb0642b5d
housekeeping tasks (#464)
* update settings to use black

* update python versions

* enquote version numbers

* update dependency

* set explicit build command

* add newline

* add command to checkout

* add run step

* chain

* sudo

* test

* newer sphinx version

* update sphinx

* clean up setuptools usage

* use tox

* install tox

* tox
2021-10-30 22:21:34 +02:00
Patrick Kanzler 435f2bba24 reformat codebase 2021-10-30 18:15:22 +02:00
Patrick Kanzler a2e348d04a fix typos 2020-10-04 14:30:03 +02:00
Patrick Kanzler 40c8399a68 update documentation on STAR TSP100
fixes #410 and #403
2020-10-04 14:28:09 +02:00
Patrick Kanzler 2d798ca7e5 add hint on proper script names
fixes #404
2020-09-28 19:51:49 +02:00
Maximilian Wagenbach c57b9c35dc Use https links. 2020-05-31 16:21:42 +02:00
Patrick Kanzler e3cf088d69 improve output of authors script 2020-05-26 21:29:16 +02:00
Patrick Kanzler 323db98318 make gen authors more robust 2020-05-26 20:43:24 +02:00
Patrick Kanzler ff39908674
Merge branch 'master' into 390-add-spellcheck-to-sphinx 2020-05-11 23:45:34 +02:00
Patrick Kanzler f4e214ad17 add spellchecker with first conf, fix some errors 2020-05-11 23:39:56 +02:00
Patrick Kanzler 9e406efc86 add sphinxcontrib-spelling 2020-05-11 23:22:40 +02:00
Patrick Kanzler b9e3827867 use pkg_resources
This change uses if no path for e capabilities-file is supplied a
temporary file created by pkg_resources, which should be more robust
than directly accessing the file. (This failed sometimes, for example
in zipped distributions or uncommon structures)
2020-05-11 22:54:22 +02:00
Romain Porte b0ea9aec41 barcodes: replace viivakoodi with python-barcode
python-barcode is yet another clone of the PyPI barcode library, but
which is still developped compared to viivakoodi.

Signed-off-by: Romain Porte <microjoe@microjoe.org>
2020-05-10 13:36:16 +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
Alexander Bougakov e350a49cad
Clarify the positions of vendor_id and product_id
An existing example uses same value, `0x1a2b`  in both `Vendor id` and `Product id` fields, which can confuse a new user.
2020-03-22 13:36:49 +03:00
Patrick Kanzler fa140c2df5 cleanup todo page 2019-06-19 15:50:19 +02:00
Patrick Kanzler 29a546821b doc add example for Serial on Windows
fixes #322
2019-06-10 22:05:26 +02:00
Patrick Kanzler 1439b14686
tell sort to ignore case 2017-08-31 13:43:07 +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 c3e952befa
cat authorsfiles during check 2017-06-19 11:15:04 +00: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