Skip to content

Commit

Permalink
restore removed functions during refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
vulpes2 committed Jul 29, 2024
1 parent a0ee20d commit aef867e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion brother_ql/backends/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def discover(backend_identifier="pyusb"):
backend_identifier = "pyusb"
be = backend_factory(backend_identifier)
list_available_devices = be["list_available_devices"]
return list_available_devices()
BrotherQLBackend = be['backend_class']
return list_available_devices

def send(instructions, printer_identifier=None, backend_identifier=None, blocking=True):
"""
Expand Down
7 changes: 7 additions & 0 deletions brother_ql/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ def discover(ctx):
"Found a label printer at: {identifier} (model: {model})".format(**result),
)

def discover_and_list_available_devices(backend):
from brother_ql.backends.helpers import discover
available_devices = discover(backend_identifier=backend)
from brother_ql.output_helpers import log_discovered_devices, textual_description_discovered_devices
log_discovered_devices(available_devices)
print(textual_description_discovered_devices(available_devices))

@cli.group()
@click.pass_context
def info(ctx, *args, **kwargs):
Expand Down

0 comments on commit aef867e

Please sign in to comment.