Repository navigation
fix: support Epson TM-T20IV and skip non-device lsusb lines - #15
Merged
Merged
Conversation
- escpos_driver: add Epson TM-T20IV (04b8:0e39) to the supported USB printers, so it's detected with device_type=usb. Also added to the copy of the list in test-scripts/escpos-test.py. - views: /usb_devices.html skipped no line of lsusb output, so it crashed with IndexError when lsusb is missing or prints nothing. Skip lines without ": ID ". Both ported from superquinquin-sur-deule/debian-pywebdriver patches 00002-add-epson-tmt20iv-support and 00001-prevent-crash-on-missing-device.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small fixes ported from the Debian 13 packaging of upstream PyWebDriver, superquinquin-sur-deule/debian-pywebdriver:
04b8:0e39to the supported USB printers inescpos_driver, so a TM-T20IV is detected withdevice_type=usbon Linux. On Windows (device_type=win32), the printer goes through the Windows print queue and isn't affected. The printer list intest-scripts/escpos-test.pygets the same entry. The udev rule already covers every USB device, so it doesn't need a change./usb_devices.htmlparsed every line oflsusboutput as a device, so it crashed withIndexErrorwhenlsusbisn't installed (lsusb: not found) or prints nothing. It now skips lines without: ID.Source patches:
00002-add-epson-tmt20iv-support.patch, and theviews.pyhunk of00001-prevent-crash-on-missing-device.patch.Test plan
pre-commit runpasses on the changed files.Ran
usb_devices()with fakelsusboutput:lsusboutputlsusb: not foundIndexErrorIndexErrorPlug a TM-T20IV in over USB on Linux and check it shows as Connected on the status page. (Not done: no TM-T20IV on hand.)