format with black

This commit is contained in:
Patrick Kanzler 2023-04-19 22:11:09 +02:00
parent cbf887ed02
commit 70d4da1364
5 changed files with 16 additions and 16 deletions

View File

@ -66,8 +66,8 @@ source_suffix = ".rst"
master_doc = "index"
# General information about the project.
project = u"python-escpos"
copyright = u"2016, Manuel F Martinez and others"
project = "python-escpos"
copyright = "2016, Manuel F Martinez and others"
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@ -229,8 +229,8 @@ latex_documents = [
(
"index",
"python-escpos.tex",
u"python-escpos Documentation",
u"Manuel F Martinez and others",
"python-escpos Documentation",
"Manuel F Martinez and others",
"manual",
),
]
@ -264,8 +264,8 @@ man_pages = [
(
"index",
"python-escpos",
u"python-escpos Documentation",
[u"Manuel F Martinez and others"],
"python-escpos Documentation",
["Manuel F Martinez and others"],
1,
)
]
@ -283,8 +283,8 @@ texinfo_documents = [
(
"index",
"python-escpos",
u"python-escpos Documentation",
u"Manuel F Martinez and others",
"python-escpos Documentation",
"Manuel F Martinez and others",
"python-escpos",
"One line description of project.",
"Miscellaneous",

View File

@ -68,7 +68,7 @@ def forecast(idx):
printer.text(deg)
printer.text("\n")
# take care of pesky unicode dash
printer.text(cond.replace(u"\u2013", "-").encode("utf-8"))
printer.text(cond.replace("\u2013", "-").encode("utf-8"))
printer.text("\n \n")

View File

@ -1078,7 +1078,7 @@ class EscposIO(object):
for line in lines:
self.printer.set(**params)
if isinstance(text, six.text_type):
self.printer.text(u"{0}\n".format(line))
self.printer.text("{0}\n".format(line))
else:
self.printer.text("{0}\n".format(line))

View File

@ -77,7 +77,7 @@ class Encoder(object):
assert len(encodable_chars) == 128
return encodable_chars
elif "python_encode" in codepage:
encodable_chars = [u" "] * 128
encodable_chars = [" "] * 128
for i in range(0, 128):
codepoint = i + 128
try:

View File

@ -24,13 +24,13 @@ class TestEncoder:
"""
def test_can_encode(self):
assert not Encoder({"CP437": 1}).can_encode("CP437", u"")
assert Encoder({"CP437": 1}).can_encode("CP437", u"á")
assert not Encoder({"CP437": 1}).can_encode("CP437", "")
assert Encoder({"CP437": 1}).can_encode("CP437", "á")
assert not Encoder({"foobar": 1}).can_encode("foobar", "a")
def test_find_suitable_encoding(self):
assert not Encoder({"CP437": 1}).find_suitable_encoding(u"")
assert Encoder({"CP858": 1}).find_suitable_encoding(u"") == "CP858"
assert not Encoder({"CP437": 1}).find_suitable_encoding("")
assert Encoder({"CP858": 1}).find_suitable_encoding("") == "CP858"
@raises(ValueError)
def test_get_encoding(self):
@ -90,7 +90,7 @@ class TestMagicEncode:
encoder=Encoder({"CP437": 1}),
encoding="CP437",
)
encode.write(u"€ ist teuro.")
encode.write("€ ist teuro.")
assert driver.output == b"_ ist teuro."
class TestForceEncoding: