-
Notifications
You must be signed in to change notification settings - Fork 9
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
Device dependent margins/config #54
Changes from 1 commit
d73626d
06f61ea
3aecdc7
1872e40
1b279b3
2353512
dcc6234
040f2c2
f907b8b
d64c977
a7def5e
d8dcb3d
4fc8b68
1d36049
d8b3b6d
13fa9b9
424ec34
d342a04
1786928
16d82e8
e239867
b390217
0bdf8fd
a4ed930
fdf3538
0fa7ad5
7246473
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -238,7 +238,7 @@ def _raw_print_label(self, lines: list[list[int]]): | |
|
||
class DymoLabeler: | ||
_device: UsbDevice | None | ||
_deviceConfig: DeviceConfig | None | ||
_deviceConfig: DeviceConfig | ||
tape_size_mm: int | ||
|
||
LABELER_DISTANCE_BETWEEN_PRINT_HEAD_AND_CUTTER_MM = 8.1 | ||
|
@@ -254,14 +254,15 @@ def __init__( | |
|
||
if self._device is not None: | ||
# Retrieve device config | ||
self._deviceConfig = get_device_config_by_id(self._device.id_product) | ||
foundConfig = get_device_config_by_id(self._device.id_product) | ||
if foundConfig is not None: | ||
self._deviceConfig = foundConfig | ||
else: | ||
raise ValueError(f"Unsupported device type {self._device.id_product}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you return There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question... will fix. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
else: | ||
# Use simulator config | ||
self._deviceConfig = SIMULATOR_CONFIG | ||
|
||
if self._deviceConfig is None: | ||
raise ValueError(f"Unsupported device type {device.id_product}") | ||
|
||
if tape_size_mm is None: | ||
tape_size_mm = self.DEFAULT_TAPE_SIZE_MM | ||
if tape_size_mm not in self._deviceConfig.supportedTapeSizes: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As before, style comment. Please use the following convention:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed