Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New unified CLI: brother_ql #37

Merged
merged 7 commits into from
Aug 8, 2018
Merged

New unified CLI: brother_ql #37

merged 7 commits into from
Aug 8, 2018

Conversation

pklaus
Copy link
Owner

@pklaus pklaus commented Aug 8, 2018

A new unified CLI named brother_ql just like the package itself was added in those commits.

This will slowly deprecate the other CLIs such as

  • brother_ql_create
  • brother_ql_print
  • brother_ql_info
  • brother_ql_analyze
  • brother_ql_debug

The new CLI is based on click giving it a lot of features out of the box such as setting parameters via environment variables, very flexible command handling, ...

To implement the new CLI with as little overhead as possible, a lot of the code previously found in the source files of the old CLI tools was moved into generic modules. For example, the code to create a label is now found in the function convert() in brother_ql.conversion instead of its previous place in the function create_label() in brother_ql.brother_ql_create.

In addition, a small error was fixed in the BrotherQLReader class resulting in a TypeError raised. It's output image file names are now configurable.

API changes: The dictionary data structure returned by list_available_devices() has now a renamed key: What was string_descr before is now called 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.
The following error is resolved with this fix:
TypeError: not all arguments converted during string formatting
The member variable filename_fmt now holds the relevant
format template and can be changed after instatiation.
The rename was:
brother_ql.{printing,discovering} -> brother_ql.backends.helpers
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.
This will slowly deprecate the other CLIs such as
* brother_ql_create
* brother_ql_print
* brother_ql_info
* brother_ql_analyze
* brother_ql_debug
@pklaus pklaus merged commit 142cf74 into master Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant