From c86826101d651e5de2cd9c1b6b34ac39372848af Mon Sep 17 00:00:00 2001 From: belono Date: Mon, 24 Jun 2019 23:09:43 +0200 Subject: [PATCH 01/17] Add CUPS printer connector --- src/escpos/printer.py | 89 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/src/escpos/printer.py b/src/escpos/printer.py index 54eb74a..3100e0b 100644 --- a/src/escpos/printer.py +++ b/src/escpos/printer.py @@ -389,3 +389,92 @@ if _WIN32PRINT: if self.hPrinter is None: raise Exception("Printer job not opened") win32print.WritePrinter(self.hPrinter, msg) + + +_CUPSPRINT = False +try: + import cups + import tempfile + _CUPSPRINT = True +except ImportError: + pass + +if _CUPSPRINT: + class CupsPrinter(Escpos): + """ Simple CUPS printer connector. + """ + def __init__(self, printer_name=None, *args, **kwargs): + Escpos.__init__(self, *args, **kwargs) + self.conn = cups.Connection() + self.tmpfile = None + self.printer_name = printer_name + self.job_name = '' + self.pending_job = False + self.open() + + @property + def printers(self): + """ Available CUPS printers. + """ + return self.conn.getPrinters() + + def open(self, job_name='python-escpos'): + """ Setup a new print job and target printer. + + A call to this method is required to send new jobs to + the same CUPS connection. + + Defaults to default CUPS printer. + Creates a new temporary file buffer. + """ + self.job_name = job_name + if self.printer_name not in self.printers: + self.printer_name = self.conn.getDefault() + self.tmpfile = tempfile.NamedTemporaryFile(delete=True) + + def _raw(self, msg): + """ Append any command sent in raw format to temporary file + + :param msg: arbitrary code to be printed + :type msg: bytes + """ + self.pending_job = True + try: + self.tmpfile.write(msg) + except ValueError: + self.pending_job = False + raise ValueError("Printer job not opened") + + def send(self): + """ Send the print job to the printer. + """ + if self.pending_job: + # Rewind tempfile + self.tmpfile.seek(0) + # Print temporary file via CUPS printer. + self.conn.printFile( + self.printer_name, + self.tmpfile.name, + self.job_name, + {}) + self._clear() + + def _clear(self): + """ Finish the print job. + + Remove temporary file. + """ + self.tmpfile.close() + self.pending_job = False + + def close(self): + """ Close CUPS connection. + + Send pending job to the printer if needed. + """ + if self.pending_job: + self.send() + if self.conn: + print('Closing CUPS connection to printer {}'.format( + self.printer_name)) + self.conn = None From 6161b46d573f174a4d68b321fbcec0bbb63ca5f1 Mon Sep 17 00:00:00 2001 From: belono Date: Mon, 24 Jun 2019 23:19:37 +0200 Subject: [PATCH 02/17] Update gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index f8415e3..ce77401 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ $~ .idea/ .directory .cache/ +settings.json # temporary data temp @@ -22,6 +23,9 @@ src/escpos/version.py .hypothesis .pytest_cache/ +# pyenv +.python-version + # testing temporary directories test/test-cli-output/ From c0481f3a9a3852df9ddcc73beb13b324d9109dd2 Mon Sep 17 00:00:00 2001 From: belono Date: Thu, 27 Jun 2019 00:18:41 +0200 Subject: [PATCH 03/17] Add user to mailmap --- .mailmap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.mailmap b/.mailmap index 4540049..568eac4 100644 --- a/.mailmap +++ b/.mailmap @@ -13,3 +13,5 @@ csoft2k Sergio Pulgarin reck31 Alex Debiasio + +belono Benito López From 2110431d4f7d6df814fd93665efc193b3a0ee1aa Mon Sep 17 00:00:00 2001 From: belono Date: Thu, 27 Jun 2019 00:26:49 +0200 Subject: [PATCH 04/17] Fix whitespace --- src/escpos/printer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/escpos/printer.py b/src/escpos/printer.py index 3100e0b..0aa7dac 100644 --- a/src/escpos/printer.py +++ b/src/escpos/printer.py @@ -469,7 +469,7 @@ if _CUPSPRINT: def close(self): """ Close CUPS connection. - + Send pending job to the printer if needed. """ if self.pending_job: From f07d5e06109e37aa45a5a139f49f56d6399b98d3 Mon Sep 17 00:00:00 2001 From: belono Date: Sun, 10 Nov 2019 16:35:52 +0100 Subject: [PATCH 05/17] Force send job unfiltered (raw) --- src/escpos/printer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/escpos/printer.py b/src/escpos/printer.py index 2e0c663..c3666c3 100644 --- a/src/escpos/printer.py +++ b/src/escpos/printer.py @@ -456,7 +456,7 @@ if _CUPSPRINT: self.printer_name, self.tmpfile.name, self.job_name, - {}) + {"document-format": cups.CUPS_FORMAT_RAW}) self._clear() def _clear(self): From 39826c3286a3771295eb5ce10c9a12bfe4f33386 Mon Sep 17 00:00:00 2001 From: belono Date: Mon, 15 Aug 2022 22:22:44 +0200 Subject: [PATCH 06/17] Fix .mailmap --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index 568eac4..fe88047 100644 --- a/.mailmap +++ b/.mailmap @@ -13,5 +13,6 @@ csoft2k Sergio Pulgarin reck31 Alex Debiasio +Maximilian Wagenbach belono Benito López From f0760ddbc0c75cf8d07baf8e58b51949e9ecf32e Mon Sep 17 00:00:00 2001 From: belono Date: Sun, 28 Aug 2022 21:39:01 +0200 Subject: [PATCH 07/17] Add support for remote CUPS server --- src/escpos/printer.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/escpos/printer.py b/src/escpos/printer.py index c3666c3..91cc07f 100644 --- a/src/escpos/printer.py +++ b/src/escpos/printer.py @@ -404,7 +404,22 @@ if _CUPSPRINT: """ Simple CUPS printer connector. """ def __init__(self, printer_name=None, *args, **kwargs): + """CupsPrinter constructor. + + :param printer_name: CUPS printer name (Optional) + :type printer_name: str + :param host: CUPS server host/ip (Optional) + :type host: str + :param port: CUPS server port (Optional) + :type port: int + """ Escpos.__init__(self, *args, **kwargs) + host, port = args or ( + kwargs.get('host', cups.getServer()), + kwargs.get('port', cups.getPort()) + ) + cups.setServer(host) + cups.setPort(port) self.conn = cups.Connection() self.tmpfile = None self.printer_name = printer_name From 9a3057c8a86ae6376c26d4efe3c1b3bf6bb0e6f3 Mon Sep 17 00:00:00 2001 From: belono Date: Thu, 24 Nov 2022 00:11:01 +0100 Subject: [PATCH 08/17] Add LP Connector - UNIX printing via lp command --- src/escpos/printer.py | 113 +++++++++++++++++++++++++++++------------- 1 file changed, 79 insertions(+), 34 deletions(-) diff --git a/src/escpos/printer.py b/src/escpos/printer.py index 7ee0961..0395207 100644 --- a/src/escpos/printer.py +++ b/src/escpos/printer.py @@ -9,14 +9,35 @@ """ -import serial +import os import socket +import subprocess +import sys + +import serial import usb.core import usb.util from .escpos import Escpos from .exceptions import USBNotFoundError +_WIN32PRINT = False +try: + import win32print + + _WIN32PRINT = True +except ImportError: + pass + +_CUPSPRINT = False +try: + import cups + import tempfile + + _CUPSPRINT = True +except ImportError: + pass + class Usb(Escpos): """USB printer @@ -371,14 +392,6 @@ class Dummy(Escpos): pass -_WIN32PRINT = False -try: - import win32print - - _WIN32PRINT = True -except ImportError: - pass - if _WIN32PRINT: class Win32Raw(Escpos): @@ -421,18 +434,11 @@ if _WIN32PRINT: win32print.WritePrinter(self.hPrinter, msg) -_CUPSPRINT = False -try: - import cups - import tempfile - _CUPSPRINT = True -except ImportError: - pass - if _CUPSPRINT: + class CupsPrinter(Escpos): - """ Simple CUPS printer connector. - """ + """Simple CUPS printer connector.""" + def __init__(self, printer_name=None, *args, **kwargs): """CupsPrinter constructor. @@ -445,26 +451,25 @@ if _CUPSPRINT: """ Escpos.__init__(self, *args, **kwargs) host, port = args or ( - kwargs.get('host', cups.getServer()), - kwargs.get('port', cups.getPort()) + kwargs.get("host", cups.getServer()), + kwargs.get("port", cups.getPort()), ) cups.setServer(host) cups.setPort(port) self.conn = cups.Connection() self.tmpfile = None self.printer_name = printer_name - self.job_name = '' + self.job_name = "" self.pending_job = False self.open() @property def printers(self): - """ Available CUPS printers. - """ + """Available CUPS printers.""" return self.conn.getPrinters() - def open(self, job_name='python-escpos'): - """ Setup a new print job and target printer. + def open(self, job_name="python-escpos"): + """Setup a new print job and target printer. A call to this method is required to send new jobs to the same CUPS connection. @@ -478,7 +483,7 @@ if _CUPSPRINT: self.tmpfile = tempfile.NamedTemporaryFile(delete=True) def _raw(self, msg): - """ Append any command sent in raw format to temporary file + """Append any command sent in raw format to temporary file :param msg: arbitrary code to be printed :type msg: bytes @@ -491,8 +496,7 @@ if _CUPSPRINT: raise ValueError("Printer job not opened") def send(self): - """ Send the print job to the printer. - """ + """Send the print job to the printer.""" if self.pending_job: # Rewind tempfile self.tmpfile.seek(0) @@ -501,11 +505,12 @@ if _CUPSPRINT: self.printer_name, self.tmpfile.name, self.job_name, - {"document-format": cups.CUPS_FORMAT_RAW}) + {"document-format": cups.CUPS_FORMAT_RAW}, + ) self._clear() def _clear(self): - """ Finish the print job. + """Finish the print job. Remove temporary file. """ @@ -513,13 +518,53 @@ if _CUPSPRINT: self.pending_job = False def close(self): - """ Close CUPS connection. + """Close CUPS connection. Send pending job to the printer if needed. """ if self.pending_job: self.send() if self.conn: - print('Closing CUPS connection to printer {}'.format( - self.printer_name)) + print("Closing CUPS connection to printer {}".format(self.printer_name)) self.conn = None + + +if not sys.platform.startswith("win"): + + class LP(Escpos): + """Simple UNIX lp raw printing. + + From https://github.com/python-escpos/python-escpos/pull/348#issuecomment-549558316 + """ + + def __init__(self, printer_name: str, *args, **kwargs): + Escpos.__init__(self, *args, **kwargs) + self.printer_name = printer_name + self.auto_flush = kwargs.get("auto_flush", True) + self.open() + + def open(self): + self.lp = subprocess.Popen( + ["lp", "-d", self.printer_name, "-o", "raw"], + stdin=subprocess.PIPE, + stdout=open(os.devnull, "w"), + ) + + def close(self): + self.lp.terminate() + + def flush(self): + if self.lp.stdin.writable(): + self.lp.stdin.write(b"\n") + if self.lp.stdin.closed is False: + self.lp.stdin.close() + self.lp.wait() + self.open() + + def _raw(self, msg): + if self.lp.stdin.writable(): + self.lp.stdin.write(msg) + else: + raise Exception("Not a valid pipe for lp process") + if self.auto_flush: + self.flush() From 84a3912b34bc0d76afc308cbcc7b8097861c2f0e Mon Sep 17 00:00:00 2001 From: belono Date: Thu, 24 Nov 2022 11:50:22 +0100 Subject: [PATCH 09/17] Fix docs build - libenchant1c2a -> libenchant-2-2 --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 3b44bb6..ceb4853 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -25,7 +25,7 @@ jobs: - name: Install packages run: sudo apt-get update -y && - sudo apt-get install -y git python3-sphinx graphviz libenchant1c2a && + sudo apt-get install -y git python3-sphinx graphviz libenchant-2-2 && sudo pip install tox - name: Test doc build run: tox -e docs From 49ab3f35a829e8b5df1ffbc50c601d2722ca006c Mon Sep 17 00:00:00 2001 From: belono Date: Thu, 24 Nov 2022 12:09:04 +0100 Subject: [PATCH 10/17] Fix build version targets for ubuntu-latest 22.04 --- .github/workflows/pythonpackage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 43d282c..cb2c195 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v3 From 69e9dca761cbc2b03d5ae54865926482d8953b1d Mon Sep 17 00:00:00 2001 From: belono Date: Thu, 24 Nov 2022 20:23:21 +0100 Subject: [PATCH 11/17] Fix black linter checks - Remove u"" strings --- doc/conf.py | 16 ++++++++-------- examples/weather.py | 2 +- src/escpos/escpos.py | 2 +- src/escpos/magicencode.py | 2 +- test/test_magicencode.py | 10 +++++----- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 24d0b05..33290d6 100644 --- a/doc/conf.py +++ b/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", diff --git a/examples/weather.py b/examples/weather.py index 2584a4d..033f3b9 100644 --- a/examples/weather.py +++ b/examples/weather.py @@ -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") diff --git a/src/escpos/escpos.py b/src/escpos/escpos.py index c714d31..4ee6026 100644 --- a/src/escpos/escpos.py +++ b/src/escpos/escpos.py @@ -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)) diff --git a/src/escpos/magicencode.py b/src/escpos/magicencode.py index 11e1b02..0ed839a 100644 --- a/src/escpos/magicencode.py +++ b/src/escpos/magicencode.py @@ -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: diff --git a/test/test_magicencode.py b/test/test_magicencode.py index f45e1f0..5debbbe 100644 --- a/test/test_magicencode.py +++ b/test/test_magicencode.py @@ -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: From ea61f287cb9563c72ec67e4f5e79bbea8c53035f Mon Sep 17 00:00:00 2001 From: belono Date: Sun, 11 Dec 2022 16:29:33 +0100 Subject: [PATCH 12/17] Add/Improve documentation of the new connectors --- doc/user/printers.rst | 31 +++++++++++++++++++++++++++++-- src/escpos/printer.py | 29 +++++++++++++++++++++++++---- 2 files changed, 54 insertions(+), 6 deletions(-) diff --git a/doc/user/printers.rst b/doc/user/printers.rst index 1e3484b..71d8af7 100644 --- a/doc/user/printers.rst +++ b/doc/user/printers.rst @@ -1,9 +1,9 @@ ******** Printers ******** -:Last Reviewed: 2017-01-25 +:Last Reviewed: 2022-11-25 -As of now there are 5 different type of printer implementations. +As of now there are 7 different type of printer implementations. USB --- @@ -75,3 +75,30 @@ all of the "output" as raw ESC/POS in a string and returns that. :member-order: bysource :noindex: +CUPS +---- +This driver uses `pycups` in order to communicate with a CUPS server. +Supports both local and remote CUPS printers and servers. +The printer must be properly configured in CUPS administration. +The connector generates a print job that is added to the CUPS queue. + +.. autoclass:: escpos.printer.CupsPrinter + :members: + :special-members: + :member-order: bysource + :noindex: + +LP +---- +This driver uses the UNIX command `lp` in order to communicate with a CUPS server. +Supports local and remote CUPS printers. +The printer must be properly configured in CUPS administration. +The connector spawns a new sub-process where the command lp is executed. + +No dependencies required, but somehow the print queue will affect some print job such as barcode. + +.. autoclass:: escpos.printer.LP + :members: + :special-members: + :member-order: bysource + :noindex: diff --git a/src/escpos/printer.py b/src/escpos/printer.py index 0395207..06e48a2 100644 --- a/src/escpos/printer.py +++ b/src/escpos/printer.py @@ -437,10 +437,16 @@ if _WIN32PRINT: if _CUPSPRINT: class CupsPrinter(Escpos): - """Simple CUPS printer connector.""" + """Simple CUPS printer connector. + + .. note:: + Requires _pycups_ which in turn needs the cups development library package: + - Ubuntu/Debian: _libcups2-dev_ + - OpenSuse/Fedora: _cups-devel_ + """ def __init__(self, printer_name=None, *args, **kwargs): - """CupsPrinter constructor. + """CupsPrinter class constructor. :param printer_name: CUPS printer name (Optional) :type printer_name: str @@ -532,18 +538,26 @@ if _CUPSPRINT: if not sys.platform.startswith("win"): class LP(Escpos): - """Simple UNIX lp raw printing. + """Simple UNIX lp command raw printing. - From https://github.com/python-escpos/python-escpos/pull/348#issuecomment-549558316 + Thanks to `Oyami-Srk comment `_. """ def __init__(self, printer_name: str, *args, **kwargs): + """LP class constructor. + + :param printer_name: CUPS printer name (Optional) + :type printer_name: str + :param auto_flush: Automatic flush after every _raw() (Optional) + :type auto_flush: bool + """ Escpos.__init__(self, *args, **kwargs) self.printer_name = printer_name self.auto_flush = kwargs.get("auto_flush", True) self.open() def open(self): + """Invoke _lp_ in a new subprocess and wait for commands.""" self.lp = subprocess.Popen( ["lp", "-d", self.printer_name, "-o", "raw"], stdin=subprocess.PIPE, @@ -551,9 +565,11 @@ if not sys.platform.startswith("win"): ) def close(self): + """Stop the subprocess.""" self.lp.terminate() def flush(self): + """End line and wait for new commands""" if self.lp.stdin.writable(): self.lp.stdin.write(b"\n") if self.lp.stdin.closed is False: @@ -562,6 +578,11 @@ if not sys.platform.startswith("win"): self.open() def _raw(self, msg): + """Write raw command(s) to the printer. + + :param msg: arbitrary code to be printed + :type msg: bytes + """ if self.lp.stdin.writable(): self.lp.stdin.write(msg) else: From fe9c0573f8318421dcb6b60d162c521b68c59beb Mon Sep 17 00:00:00 2001 From: belono Date: Sun, 11 Dec 2022 18:41:05 +0100 Subject: [PATCH 13/17] Fix docs build --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index ea27473..20f1415 100644 --- a/tox.ini +++ b/tox.ini @@ -22,7 +22,7 @@ deps = nose hypothesis>4 python-barcode commands = pytest --cov escpos -passenv = ESCPOS_CAPABILITIES_PICKLE_DIR ESCPOS_CAPABILITIES_FILE CI TRAVIS TRAVIS_* APPVEYOR APPVEYOR_* CODECOV_* +passenv = ESCPOS_CAPABILITIES_PICKLE_DIR, ESCPOS_CAPABILITIES_FILE, CI, TRAVIS, TRAVIS_*, APPVEYOR, APPVEYOR_*, CODECOV_* [testenv:docs] basepython = python From b1a1204bb8c53444fa9189e4e5991782d2c0c72f Mon Sep 17 00:00:00 2001 From: belono Date: Fri, 14 Apr 2023 12:36:15 +0200 Subject: [PATCH 14/17] Add _read() method to the CupsPrinter() connector --- src/escpos/printer.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/escpos/printer.py b/src/escpos/printer.py index 06e48a2..f2fbe6e 100644 --- a/src/escpos/printer.py +++ b/src/escpos/printer.py @@ -523,6 +523,17 @@ if _CUPSPRINT: self.tmpfile.close() self.pending_job = False + def _read(self): + """Return a single-item array with the accepting state of the print queue. + + states: idle = [3], printing a job = [4], stopped = [5] + """ + printer = self.printers.get(self.printer_name, {}) + state = printer.get("printer-state") + if not state: + return [] + return [state] + def close(self): """Close CUPS connection. From 2b0d57a9c74b6505b192c59f822f128c8652e835 Mon Sep 17 00:00:00 2001 From: Patrick Kanzler Date: Wed, 19 Apr 2023 22:34:08 +0200 Subject: [PATCH 15/17] install pycups packages in doc build --- .github/workflows/documentation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index bbfed08..f3f03d4 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -26,6 +26,7 @@ jobs: run: sudo apt-get update -y && sudo apt-get install -y git python3-sphinx graphviz libenchant-2-2 && + sudo apt-get install -y gcc libcups2-dev python3-dev python3-setuptools sudo pip install tox pycups - name: Test doc build run: tox -e docs From de515a86cc1fbb4f5aad5c92418f71ebab4aca2e Mon Sep 17 00:00:00 2001 From: Patrick Kanzler Date: Wed, 19 Apr 2023 22:36:20 +0200 Subject: [PATCH 16/17] add && --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index f3f03d4..2508ab5 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -26,7 +26,7 @@ jobs: run: sudo apt-get update -y && sudo apt-get install -y git python3-sphinx graphviz libenchant-2-2 && - sudo apt-get install -y gcc libcups2-dev python3-dev python3-setuptools + sudo apt-get install -y gcc libcups2-dev python3-dev python3-setuptools && sudo pip install tox pycups - name: Test doc build run: tox -e docs From 98ee06a783366f539748f9f56f3a5b32e21a5b33 Mon Sep 17 00:00:00 2001 From: Patrick Kanzler Date: Wed, 19 Apr 2023 22:42:55 +0200 Subject: [PATCH 17/17] preliminarily deactivate cups printer documentation --- doc/user/printers.rst | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/doc/user/printers.rst b/doc/user/printers.rst index 71d8af7..7c5ce8f 100644 --- a/doc/user/printers.rst +++ b/doc/user/printers.rst @@ -82,11 +82,7 @@ Supports both local and remote CUPS printers and servers. The printer must be properly configured in CUPS administration. The connector generates a print job that is added to the CUPS queue. -.. autoclass:: escpos.printer.CupsPrinter - :members: - :special-members: - :member-order: bysource - :noindex: +.. todo:: fix import in documentation LP ----