Skip to content
This repository was archived by the owner on May 16, 2023. It is now read-only.

Fix pylint errors #31

Merged
merged 1 commit into from
Nov 8, 2022
Merged

Fix pylint errors #31

merged 1 commit into from
Nov 8, 2022

Conversation

tekktrik
Copy link
Member

@tekktrik tekktrik commented Nov 8, 2022

Fixed the following pylint errors:

Error: pylint (library code)....................................................Failed
- hook id: pylint
- exit code: 8

************* Module adafruit_thermal_printer.thermal_printer_legacy
adafruit_thermal_printer/thermal_printer_legacy.py:1:0: R0801: Similar lines in 2 files
==adafruit_thermal_printer.thermal_printer_2168:[27:67]
==adafruit_thermal_printer.thermal_printer_264:[36:73]
class ThermalPrinter(thermal_printer.ThermalPrinter):
    """Thermal printer for printers with firmware version 2.64 up to (but
    NOT including) 2.68.
    """

    # Barcode types.  These vary based on the firmware version so are made
    # as class-level variables that users can reference (i.e.
    # ThermalPrinter.UPC_A, etc) and write code that is independent of the
    # printer firmware version.
    UPC_A = 65
    UPC_E = 66
    EAN13 = 67
    EAN8 = 68
    CODE39 = 69
    ITF = 70
    CODABAR = 71
    CODE93 = 72
    CODE128 = 73

    def __init__(
        self, uart, byte_delay_s=0.00057346, dot_feed_s=0.0021, dot_print_s=0.03
    ):
        """Thermal printer class.  Requires a serial UART connection with at
        least the TX pin connected.  Take care connecting RX as the printer
        will output a 5V signal which can damage boards!  If RX is unconnected
        the only loss in functionality is the has_paper function, all other
        printer functions will continue to work.  The byte_delay_s, dot_feed_s,
        and dot_print_s values are delays which are used to prevent overloading
        the printer with data.  Use the default delays unless you fully
        understand the workings of the printer and how delays, baud rate,
        number of dots, heat time, etc. relate to each other.
        """
        super().__init__(
            uart,
            byte_delay_s=byte_delay_s,
            dot_feed_s=dot_feed_s,
            dot_print_s=dot_print_s, (duplicate-code)

@tekktrik tekktrik requested review from kattni and evaherrada November 8, 2022 01:58
@kattni kattni merged commit 5256986 into adafruit:main Nov 8, 2022
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Nov 12, 2022
Updating https://github.com/adafruit/Adafruit_CircuitPython_Thermal_Printer to 1.3.12 from 1.3.11:
  > Merge pull request adafruit/Adafruit_CircuitPython_Thermal_Printer#28 from tcfranks/main
  > Merge pull request adafruit/Adafruit_CircuitPython_Thermal_Printer#31 from tekktrik/dev/fix-pylint-errors
  > Update .pylintrc for v2.15.5
  > Fix release CI files
  > Update pylint to 2.15.5
  > Updated pylint version to 2.13.0
  > Switching to composite actions
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants