mirror of
				https://github.com/python-escpos/python-escpos
				synced 2025-10-23 09:30:00 +00:00 
			
		
		
		
	Fix black linter checks - Remove u"" strings
This commit is contained in:
		
							
								
								
									
										16
									
								
								doc/conf.py
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								doc/conf.py
									
									
									
									
									
								
							@@ -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",
 | 
			
		||||
 
 | 
			
		||||
@@ -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")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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))
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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:
 | 
			
		||||
 
 | 
			
		||||
@@ -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:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user