run isort & black
This commit is contained in:
parent
6aec41fbd8
commit
5bd936b585
@ -18,8 +18,8 @@ import calendar
|
||||
import json
|
||||
import os
|
||||
import time
|
||||
from urllib.request import urlopen
|
||||
from datetime import datetime
|
||||
from urllib.request import urlopen
|
||||
|
||||
from escpos.printer import Usb
|
||||
|
||||
|
@ -578,9 +578,7 @@ def main() -> None:
|
||||
if not args_dict:
|
||||
parser.print_help()
|
||||
sys.exit()
|
||||
command_arguments = dict(
|
||||
[k, v] for k, v in args_dict.items() if v is not None
|
||||
)
|
||||
command_arguments = dict([k, v] for k, v in args_dict.items() if v is not None)
|
||||
|
||||
# If version should be printed, do this, then exit
|
||||
print_version = command_arguments.pop("version", None)
|
||||
|
@ -46,7 +46,7 @@ class Config:
|
||||
self._printer_name = None
|
||||
self._printer_config = None
|
||||
|
||||
def load(self, config_path = None):
|
||||
def load(self, config_path=None):
|
||||
"""Load and parse the configuration file using pyyaml.
|
||||
|
||||
:param config_path: An optional file path, file handle, or byte string
|
||||
|
@ -46,9 +46,7 @@ HW_RESET: bytes = ESC + b"\x3f\x0a\x00" # Reset printer hardware
|
||||
# (TODO: Where is this specified?)
|
||||
|
||||
# Cash Drawer (ESC p <pin> <on time: 2*ms> <off time: 2*ms>)
|
||||
_CASH_DRAWER = (
|
||||
lambda m, t1="", t2="": ESC + b"p" + m + bytes((t1, t2))
|
||||
)
|
||||
_CASH_DRAWER = lambda m, t1="", t2="": ESC + b"p" + m + bytes((t1, t2))
|
||||
|
||||
#: decimal cash drawer kick sequence
|
||||
CD_KICK_DEC_SEQUENCE = (
|
||||
|
@ -16,7 +16,7 @@ import warnings
|
||||
from abc import ABCMeta, abstractmethod # abstract base class support
|
||||
from re import match as re_match
|
||||
from types import TracebackType
|
||||
from typing import List, Literal, Optional, Union, Any
|
||||
from typing import Any, List, Literal, Optional, Union
|
||||
|
||||
import barcode
|
||||
import qrcode
|
||||
@ -857,7 +857,7 @@ class Escpos(object, metaclass=ABCMeta):
|
||||
image = my_code.writer._image
|
||||
self.image(image, impl=impl, center=center)
|
||||
|
||||
def text(self, txt:str) -> None:
|
||||
def text(self, txt: str) -> None:
|
||||
"""Print alpha-numeric text.
|
||||
|
||||
The text has to be encoded in the currently selected codepage.
|
||||
@ -1443,15 +1443,12 @@ class EscposIO:
|
||||
"""
|
||||
self.printer.close()
|
||||
|
||||
def __enter__(self, **kwargs: Any) -> 'EscposIO':
|
||||
def __enter__(self, **kwargs: Any) -> "EscposIO":
|
||||
"""Enter context."""
|
||||
return self
|
||||
|
||||
def __exit__(
|
||||
self,
|
||||
type: type[BaseException],
|
||||
value: BaseException,
|
||||
traceback: TracebackType
|
||||
self, type: type[BaseException], value: BaseException, traceback: TracebackType
|
||||
) -> None:
|
||||
"""Cut and close if configured.
|
||||
|
||||
|
@ -39,7 +39,7 @@ class Error(Exception):
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, msg:str, status: Optional[int] = None) -> None:
|
||||
def __init__(self, msg: str, status: Optional[int] = None) -> None:
|
||||
"""Initialize Error object."""
|
||||
Exception.__init__(self)
|
||||
self.msg = msg
|
||||
|
@ -10,7 +10,7 @@ This module contains the image format handler :py:class:`EscposImage`.
|
||||
|
||||
|
||||
import math
|
||||
from typing import Union, Iterator
|
||||
from typing import Iterator, Union
|
||||
|
||||
from PIL import Image, ImageOps
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
import functools
|
||||
import logging
|
||||
import tempfile
|
||||
from typing import Literal, Optional, Type, Union, List
|
||||
from typing import List, Literal, Optional, Type, Union
|
||||
|
||||
from ..escpos import Escpos
|
||||
from ..exceptions import DeviceNotFoundError
|
||||
|
Loading…
x
Reference in New Issue
Block a user