100 Commits
Author SHA1 Message Date
Philipp Klaus 56cf4394ad [fix] "response doesn't start with the usual header"
fixes #25, fixes #69, fixes #75, fixes #81

also seen in issues: #56, #71
2020-02-04 16:24:32 +01:00
Philipp Klaus 638b365d45 initial, still very untested support for PT-P750W 2019-09-02 22:37:38 +02:00
Philipp Klaus 05516a7692 'brother_ql analyze' updated to support P-Touch series files 2019-09-02 20:34:12 +02:00
Philipp Klaus b551b1fc94 make classes FormFactor() and Color() IntEnums 2019-01-21 11:28:47 +01:00
Philipp Klaus 5c2b72b18b Remove deprecation warning for now 2019-01-21 11:27:45 +01:00
Philipp Klaus 2eeac7a4b6 improve docstring documentation of brother_ql.raster 2019-01-13 11:19:04 +01:00
Philipp Klaus 99c35993c8 brother_ql.raster.Raster._unsupported() is now 'protected' 2019-01-13 11:18:26 +01:00
Philipp Klaus ca4ac0544c brother_ql.raster: remove unused import 2019-01-13 11:16:37 +01:00
Philipp Klaus 1cfc7e7302 attrs & enum based replacement for devicedependent
This change replaces the simple lists and dictionaries
defined in brother_ql/devicedependent.py with data class
definitions based on attrs. They are split into two
new modules:

* brother_ql/models.py and
* brother_ql/labels.py.

To keep the compatibility with other software relying on
this package, the old brother_ql/devicedependent.py module
can still be imported. Its content is recreated with the
help of the new modules in some _populate_legacy_structures()
functions.
2019-01-13 01:24:18 +01:00
Philipp Klaus df31020d4d Revert dataclasses based replacement for devicedependent
There is a big problem with this commit - it only works with:

* Python 3.5 and later due to
  type hints being introduced with
  PEP-484 https://www.python.org/dev/peps/pep-0484/
  lead to syntax errors on earlier versions.
* (even worse) only with Python 3.6+ due to
  PEP 526 variable annotations (introduced in 3.6)
  needed by dataclasses too.

We aim, however, at Python 2.7 compatibility with this project.

So after all, I reverse the commit and will implement the changes
in a different way.
2019-01-13 00:40:55 +01:00
Philipp Klaus 0a3af68eaa dataclasses & enum based replacement for devicedependent
This change replaces the simple lists and dictionaries
defined in brother_ql/devicedependent.py with data class
based definitions split into two new modules:

* brother_ql/models.py and
* brother_ql/labels.py.

To keep the compatibility with other software relying on
this package, the old brother_ql/devicedependent.py module
can still be imported. Its content is recreated with the
help of the new modules in some _populate_legacy_structures()
functions.
2019-01-13 00:39:30 +01:00
Philipp Klaus 40a1badd66 mark QL-560 as supported. closes #51. thx @volkermauel 2019-01-12 21:02:58 +01:00
Philipp Klaus bc9564e3a2 Removing SIMILAR_SOFTWARE. Now found in separate Gist. 2018-09-25 15:10:58 +02:00
Philipp Klaus 63f05c2346 Brother QL-1060N reported to be working fine w/ brother_ql 2018-09-25 15:06:31 +02:00
Philipp Klaus d589f4e2fe QL-810W reported to be working with this package 2018-09-14 17:08:49 +02:00
Philipp Klaus 1aa793b855 README backends notes: render list properly in Markdown 2018-09-14 16:45:13 +02:00
Philipp Klaus 5bc0f949e8 README backends: *network* backend can't read printer state 2018-09-14 16:33:23 +02:00
Philipp Klaus 4820b673bb README backends: move legend into describing sentence 2018-09-14 16:29:49 +02:00
Philipp Klaus 660c7bbdf6 README: new backends section incl. table about OS support (#38) 2018-09-14 16:24:25 +02:00
Philipp Klaus 6b39795667 add pyusb to the dependencies (relates to #38) 2018-09-14 15:08:17 +02:00
Philipp Klaus f183afbe9d BrotherQLRaster: log raster_image_size as debug, not info 2018-09-14 14:59:46 +02:00
Philipp Klaus 801b36b894 brother_ql.backends.helpers.send() returns a status dictionary 2018-09-14 14:58:36 +02:00
Philipp Klaus f7e34a347a brother_ql.exceptions: easier notation and line spacings 2018-09-14 10:19:51 +02:00
Philipp Klaus 35a53b9681 new module brother_ql.exceptions for all custom exceptions 2018-09-14 10:17:59 +02:00
Philipp Klaus abd9ebe453 fix the --no-cut option of brother_ql print 2018-09-06 23:12:05 +02:00
Philipp Klaus 0c59fa9fff CLI brother_ql print: use click.File() to allow input from stdin 2018-09-06 22:59:14 +02:00
Philipp Klaus ec4b7a9529 brother_ql.reader: 'raise NameError()' instead of using 'assert' 2018-09-05 10:51:41 +02:00
Philipp Klaus c8b9c9335d update README to document --version (missing in 1fb11eb) 2018-09-03 16:51:42 +02:00
Philipp Klaus 7f28027bfe Make brother_ql info a click.group() 2018-09-03 16:50:23 +02:00
Philipp Klaus 7ab1e672b7 Fix Py2/3 compatibility (#40) 2018-09-03 15:15:58 +02:00
Philipp Klaus fe55344d32 pyusb backend: select the iface with the right bInterfaceClass right away 2018-08-14 23:05:23 +02:00
Philipp Klaus d209040b92 pyusb backend: assert seleted iface bInterfaceClass == 7 (a 'printer') 2018-08-14 23:04:23 +02:00
Philipp Klaus 78b5667ca4 New CLI command brother_ql info env
This command lists the running conditions as shown below:

##################

Information about the running environment of brother_ql.
(Please provide this information when reporting any issue.)

About the computer:
  * Platform: Linux-4.4.138-59-default-x86_64-with-SuSE-42.3-x86_64
  * Processor: x86_64
  * Release: 4.4.138-59-default
  * System: Linux
  * Machine: x86_64
  * Architecture: ('64bit', 'ELF')
About the installed Python version:
  * 3.7.0 (default, Jul 31 2018, 19:42:44)  [GCC 4.8.5]
About the brother_ql package:
  * package location: /local/pyvenv/py37loc/lib/python3.7/site-packages
  * package version:  0.9.dev0
  * brother_ql CLI path: /local/pyvenv/py37loc/bin/brother_ql
About the requirements of brother_ql:
  requirement    | requested  | installed version
  -------------- | ---------- | -----------------
  click          | any        | 6.7
  future         | any        | 0.16.0
  packbits       | any        | 0.6
  pillow         | >= 3.3.0   | 5.2.0

##################
2018-08-10 15:51:13 +02:00
Philipp Klaus 1fb11eb766 new CLI option brother_ql --version (#34) 2018-08-10 14:14:43 +02:00
Philipp Klaus 075feb3bbe Revert "new CLI command brother_ql info version (#34)"
This reverts commit b59f45fa79.
2018-08-10 12:11:15 +02:00
Philipp Klaus b59f45fa79 new CLI command brother_ql info version (#34) 2018-08-10 11:59:09 +02:00
Philipp Klaus a71fc4c09c rasterprynt included in SIMILAR_SOFTWARE.md 2018-08-10 11:44:56 +02:00
Philipp Klaus 90076beda5 Updated README: Installation, Deprecated CLI Tools
* The installation instructions were extended to cover
  the cases where pip was (willingly or not) used with
  the --user flag.
  See issue #36 were this came up.
* The use of brother_ql_{create,print,debug,analyze,info}
  is now considered deprecated.
* Furthermore: wording on brother_ql_web improved
2018-08-10 11:38:44 +02:00
Philipp Klaus b353aafbdb README: put long URLs to the end of the document 2018-08-10 11:21:47 +02:00
Philipp Klaus 90cfa1febc README: phrases start w/ new line + breaking long lines 2018-08-10 11:06:19 +02:00
Philipp Klaus 0f03cfe611 README: new sections Author / Contributing 2018-08-10 10:57:18 +02:00
Philipp Klaus 1e24d192e4 fix help in CLI brother_ql & list labels in README 2018-08-08 19:45:17 +02:00
Philipp Klaus fd2206891b Py2 compat of brother_ql.reader - fixes #35 2018-08-08 19:39:37 +02:00
Philipp Klaus 3944efad85 SIMILAR_SOFTWARE updated 2018-08-08 19:15:14 +02:00
Philipp Klaus fa8852afbb setup.py: development now reached 0.9.dev0 2018-08-08 19:05:15 +02:00
Philipp KlausandGitHub 142cf744d8 Merge pull request #37 from pklaus/dev
New unified CLI: `brother_ql`
2018-08-08 19:01:01 +02:00
Philipp Klaus 160cea90d4 new CLI: brother_ql
This will slowly deprecate the other CLIs such as
* brother_ql_create
* brother_ql_print
* brother_ql_info
* brother_ql_analyze
* brother_ql_debug
2018-08-08 18:50:01 +02:00
Philipp Klaus 388eaae2d6 Move label creating code from CLI tool brother_ql_create -> module
The code previously found in the function
create_label()  in  brother_ql.brother_ql_create
now went into a new function convert() in its own module:
convert()  in  brother_ql.conversion

In addition, the new convert() function is now able to
put more than one pages (labels) into one instruction file.
2018-08-08 18:18:07 +02:00
Philipp Klaus 480805af9a bug fixes & module rename -> brother_ql.backends.helpers
The rename was:
brother_ql.{printing,discovering} -> brother_ql.backends.helpers
2018-08-08 18:02:25 +02:00
Philipp Klaus 9e93664abe Ability to change output filename of BrotherQLReader
The member variable filename_fmt now holds the relevant
format template and can be changed after instatiation.
2018-08-08 14:42:48 +02:00
Philipp Klaus 6a94465bea fix: logging output in BrotherQLReader() raises TypeError
The following error is resolved with this fix:
TypeError: not all arguments converted during string formatting
2018-08-08 14:33:49 +02:00
Philipp Klaus c42773b613 Split brother_ql_print -> brother_ql.{printing,discovering} 2018-07-31 21:59:32 +02:00
Philipp Klaus 5267986fd0 backends: rename string_descr -> identifier
The strings like tcp://192.168.0.23:9100 or
usb://0x04f9:0x2015 are rather 'identifiers'
than descriptors (terminology).
Users relying on the returned dictionaries of the
list_available_devices() function need to update
the key from 'string_descr' to 'identifier'.
Sorry for the inconvenience.
2018-07-31 21:55:50 +02:00
Philipp Klaus 9b1311f9ba fix printing greyscale images on black/red tape 2018-07-10 12:14:07 +02:00
Philipp Klaus 351fb9bcec List supported models QL-800 QL-820NWB QL-1050 in setup.py, too 2018-02-20 21:23:58 +01:00
Philipp Klaus 4e67291a5e QL-1050 confirmed to work by jleguen in pull request #30 2018-02-20 21:19:27 +01:00
Philipp Klaus ceed43ef6e README: Remove note about missing 600dpi mode (incorrect since a354cde) 2018-01-28 13:19:44 +01:00
Philipp Klaus 19110118e0 Add hint to web interface in README 2018-01-28 13:14:12 +01:00
Philipp Klaus 6a2ff81dd3 README: Rearrange and slightly rephrase info on Editor Lite mode 2018-01-28 13:13:47 +01:00
Philipp Klaus 99ee28fdaa require pillow>=3.3.0
with pillow < 3.3.0, the call of Image.new()
in brother_ql/brother_ql_create.py line 113
would fail with the following error:

[...]
  File "/usr/lib/python3.4/site-packages/brother_ql/brother_ql_create.py", line 113, in create_label
    new_im = Image.new(im.mode, (device_pixel_width, im.size[1]), (255,)*len(im.mode))
  File "/usr/lib64/python3.4/site-packages/PIL/Image.py", line 2050, in new
    return Image()._new(core.fill(mode, size, color))
TypeError: an integer is required (got type tuple)
2018-01-15 15:26:20 +01:00
Philipp Klaus 32ba70b7dc removed import numpy overlooked in 76f4677 (fixes #26) 2018-01-06 19:03:18 +01:00
Philipp Klaus e5d4fde7d5 Correct Brother DK-11241 label size "102x152", fixes #27 2018-01-06 18:25:21 +01:00
Philipp Klaus 69d8b0395f brother_ql_print network backend timeout fix (#23) 2017-10-18 23:55:52 +02:00
Philipp Klaus e27bc9d491 brother_ql_analyze can now read from stdin (with '-') 2017-10-18 23:28:46 +02:00
Philipp Klaus aaf9a085b8 brother_ql_print: log discovered devices to stderr 2017-10-06 22:02:30 +02:00
Philipp Klaus 2f3655b648 Allow low quality printing with --lq 2017-10-06 22:01:52 +02:00
Philipp Klaus a354cde4eb New --600dpi flag to support 600x300 dpi mode 2017-10-01 20:59:05 +02:00
Philipp Klaus 88c0920768 create_label() convert rotate to int() early on if not 'auto' 2017-10-01 13:26:37 +02:00
Philipp Klaus fae49bc1dc brother_ql_print fix --list-printers to print all found printers 2017-09-19 21:57:59 +02:00
Philipp Klaus 5b3d70842e brother_ql_analyze: improved INFO output 2017-09-19 21:12:05 +02:00
Philipp Klaus 467c15ef0f raise exception (instead of sys.exit()) in create_label()
create_label() is the most important function to be used (imported)
by other Python scripts and packages. It shouldn't force its calling
code or program to terminate in case of invalid input.
2017-09-19 21:06:39 +02:00
Philipp Klaus baea505a46 brother_ql_create: fix b/w label creation from .gif files 2017-09-19 21:04:47 +02:00
Philipp Klaus ee16bd68bb pushing version to v0.8.dev0 2017-09-19 14:25:43 +02:00
Philipp Klaus b96cd35ea1 prevent using --red (two color printing) if not supported by model 2017-09-19 14:23:18 +02:00
Philipp Klaus d373acbbc7 collection of similar software with a link in the README 2017-09-19 13:52:41 +02:00
Philipp Klaus 27c35710cd also apply --threshold to --red labels 2017-09-19 13:02:47 +02:00
Philipp Klaus a15084ad02 Convert indexed images (GIF) to RGB (if printing in --red) 2017-09-19 12:54:49 +02:00
Philipp Klaus 610954f800 brother_ql_create --red speedup (saving 90% CPU time)
The dissection of the color into red, black, & white now
takes part in the HSV color space (instead of HLS before).
Pillow's built-in capabilities to convert RGB → HSV
are now used.

While the creation of --red labels still takes 16 times longer
than the simple black/white ones, it is now 90% less time than
before this commit.
2017-09-19 12:49:00 +02:00
Philipp Klaus f52afbac62 brother_ql_analyze: black overrides red 2017-09-19 10:43:21 +02:00
Philipp Klaus ed97975b9c QL-800 series: printing black/red/white labels (CLI: --red) 2017-09-19 10:42:12 +02:00
Philipp Klaus f1fd99f9a7 brother_ql_create new CLI argument --compress
* create_label() now accepts a new keyword argument compress.
  The default is False → no compression if not set manually.
  This will speed-up the label creation in many cases
  at the expense of larger file sizes. Set to True if you
  don't care about processing time but want to store the
  generated label files.
* The brother_ql_create CLI offers this via the new
  argument --compress.
  New default (if not set): no compression.
2017-09-18 21:05:50 +02:00
Philipp Klaus 00c2cb9712 fix documentation of usb:// descriptor string 2017-09-17 22:04:00 +02:00
Philipp Klaus ee69e04f80 round labels: state actual / expected size when failing 2017-09-17 21:33:02 +02:00
Philipp Klaus e2b7e2d7f6 create_label(): first .paste(), then .convert("L")
The advantage is that the conversion to grayscale is now done
in the same way for all labels just before the conversion
to b/w.
The memory footprint shouln't increase too much.
And profiling showed that the the performance for small labels
that need pasting didn't deteriorate.
2017-09-17 21:28:17 +02:00
Philipp Klaus 11227c0db6 brother_ql_create: new CLI parameter --dither 2017-09-17 20:44:08 +02:00
Philipp Klaus d681d0ee9c new kwarg dither in create_label() 2017-09-17 18:50:03 +02:00
Philipp Klaus 707c33ffff QL-820NWB is now supported, printing red/black/white not yet 2017-09-16 22:42:59 +02:00
Philipp Klaus 555a51a0ad adding device dependent settings for QL-800 series 2017-09-16 12:23:34 +02:00
Philipp Klaus f2c7dbcbce brother_ql_analyze now supports .bin files for the QL-800 series 2017-09-16 12:15:43 +02:00
Philipp Klaus b60d140ff4 README: new QL-800 series 2017-08-20 09:35:28 +02:00
Philipp Klaus 3584b6ba5d Merge pull request #16 from iegomez/master (w/o multiprocessing)
Speed up implementation
2017-07-03 11:05:36 +02:00
Philipp Klaus 2c8620f94e raster.py: Py2 compat 2017-07-03 09:46:15 +02:00
Philipp Klaus 670068ce95 removed multiprocessing for now 2017-07-03 09:45:56 +02:00
Philipp Klaus f0d924b6f6 Adding/fixing support for round labels 2017-01-01 17:13:31 +01:00
Philipp Klaus 70f500b8d0 QL-550 marked as supported 2016-12-31 17:46:01 +01:00
Philipp Klaus 6e757e1ba9 brother_ql_print's instruction_file argument now accepts - for stdin 2016-12-29 09:09:22 +01:00
Philipp Klaus 5e7855eecf adding 'name' to the label_type_specs and making it more readable 2016-12-29 09:07:55 +01:00
Philipp Klaus a4dc9e89f3 Also use transparency fix from 69ba25e for die-cut labels 2016-12-22 23:22:28 +01:00
Philipp Klaus 69ba25ee1a Fix: images with a transparency layer now use a white background 2016-12-20 14:00:25 +01:00
Philipp Klaus a8fcd553de README: link to DEBUG docs fixed 2016-12-18 12:06:29 +01:00