From fb9b4d82d29b5b6d1ea7e8bc238fdb4fda02cf4b Mon Sep 17 00:00:00 2001 From: belono Date: Sun, 16 Feb 2025 21:01:34 +0100 Subject: [PATCH 1/8] Add link to github --- doc/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index d7fba67e..2f141658 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -141,7 +141,9 @@ # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -# html_theme_options = {} +html_theme_options = dict( + github_url='https://github.com/python-escpos/python-escpos', + ) # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] From 38fdf8bffc4085251eef7fe25467b859ad249f7b Mon Sep 17 00:00:00 2001 From: belono Date: Sun, 16 Feb 2025 22:49:59 +0100 Subject: [PATCH 2/8] Add profile params to 'Documentation and Usage' --- README.rst | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index cfcebc2a..f8ca8d9e 100644 --- a/README.rst +++ b/README.rst @@ -59,7 +59,7 @@ Another example based on the Network printer class: from escpos.printer import Network - kitchen = Network("192.168.1.100") #Printer IP Address + kitchen = Network("192.168.1.100", profile="TM-T88III") #Printer IP Address kitchen.text("Hello World\n") kitchen.barcode('4006381333931', 'EAN13', 64, 2, '', '') kitchen.cut() @@ -71,18 +71,22 @@ Another example based on the Serial printer class: from escpos.printer import Serial """ 9600 Baud, 8N1, Flow Control Enabled """ - p = Serial(devfile='/dev/tty.usbserial', - baudrate=9600, - bytesize=8, - parity='N', - stopbits=1, - timeout=1.00, - dsrdtr=True) + p = Serial( + devfile='/dev/tty.usbserial', + baudrate=9600, + bytesize=8, + parity='N', + stopbits=1, + timeout=1.00, + dsrdtr=True, + profile="TM-T88III" + ) p.text("Hello World\n") p.qr("You can readme from your smartphone") p.cut() +.. note:: It is highly recommended to include a matching profile to inform python-escpos about the printer's capabilities. The full project-documentation is available on `Read the Docs `_. From de6f0f2d30740fe08e4d667749de3a0e3eefaaa7 Mon Sep 17 00:00:00 2001 From: belono Date: Sun, 16 Feb 2025 23:19:44 +0100 Subject: [PATCH 3/8] More profile additions and clarifications --- doc/user/usage.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/user/usage.rst b/doc/user/usage.rst index e986e2c1..2a1fff15 100644 --- a/doc/user/usage.rst +++ b/doc/user/usage.rst @@ -1,7 +1,7 @@ Usage ===== -:Last Reviewed: 2023-08-10 +:Last Reviewed: 2025-02-16 Define your printer ------------------- @@ -113,7 +113,7 @@ on a USB interface. from escpos import * """ Seiko Epson Corp. Receipt Printer M129 Definitions (EPSON TM-T88IV) """ - p = printer.Usb(0x04b8,0x0202) + p = printer.Usb(0x04b8,0x0202, profile="TM-T88IV") # Print text p.text("Hello World\n") # Print image @@ -180,6 +180,7 @@ An example file printer:: printer: type: File devfile: /dev/someprinter + profile: TM-U220 And for a network printer:: @@ -187,6 +188,7 @@ And for a network printer:: type: Network host: 127.0.0.1 port: 9000 + profile: TM-U220 An USB-printer could be defined by:: @@ -196,6 +198,7 @@ An USB-printer could be defined by:: idProduct: 0x5678 in_ep: 0x66 out_ep: 0x01 + profile: TM-U220 Printing text right ------------------- @@ -250,8 +253,8 @@ Here you can download an example, that will print a set of common barcodes: .. _advanced-usage-change-capabilities-profile: -Advanced Usage: change capabilities-profile -------------------------------------------- +Advanced Usage: change where is the capabilities-profile +-------------------------------------------------------- Packaged together with the escpos-code is a capabilities-file. This file in JSON-format describes the capabilities of different printers. It is developed and hosted in From 45ab9cbf825b3cbdc40e8a24ea7f720879b23909 Mon Sep 17 00:00:00 2001 From: belono Date: Sun, 16 Feb 2025 23:40:16 +0100 Subject: [PATCH 4/8] Fix code style --- doc/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 2f141658..4ac91ba2 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -142,8 +142,8 @@ # further. For a list of options available for each theme, see the # documentation. html_theme_options = dict( - github_url='https://github.com/python-escpos/python-escpos', - ) + github_url="https://github.com/python-escpos/python-escpos", +) # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] From a063e81862e32cddb78a3ed9ec2db23966dc4011 Mon Sep 17 00:00:00 2001 From: belono Date: Fri, 21 Feb 2025 20:02:56 +0100 Subject: [PATCH 5/8] Fix Include link to github in documentation topbar --- doc/conf.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 4ac91ba2..cd3a4c22 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -141,9 +141,15 @@ # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -html_theme_options = dict( - github_url="https://github.com/python-escpos/python-escpos", -) +# html_theme_options = {} + +# Show a 'Edit on GitHub' link instead of 'View page source' +html_context = { + "display_github": True, + "github_user": "python-escpos", + "github_repo": "python-escpos", + "github_version": "master", +} # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] From adef95e90f11334831ffdeb57be96f1a3b5f54cf Mon Sep 17 00:00:00 2001 From: belono Date: Fri, 21 Feb 2025 20:07:53 +0100 Subject: [PATCH 6/8] Fix Black code style --- doc/conf.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index cd3a4c22..813a5757 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -145,10 +145,10 @@ # Show a 'Edit on GitHub' link instead of 'View page source' html_context = { - "display_github": True, - "github_user": "python-escpos", - "github_repo": "python-escpos", - "github_version": "master", + "display_github": True, + "github_user": "python-escpos", + "github_repo": "python-escpos", + "github_version": "master", } # Add any paths that contain custom themes here, relative to this directory. From 11c32967df05f480a26cc44d901360068cb21357 Mon Sep 17 00:00:00 2001 From: belono Date: Fri, 21 Feb 2025 20:18:52 +0100 Subject: [PATCH 7/8] Fix GH link --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 813a5757..3725df43 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -148,7 +148,7 @@ "display_github": True, "github_user": "python-escpos", "github_repo": "python-escpos", - "github_version": "master", + "github_version": "master/", } # Add any paths that contain custom themes here, relative to this directory. From 25d1af7821c1339c49ad5675e7c899afff72d11a Mon Sep 17 00:00:00 2001 From: belono Date: Fri, 21 Feb 2025 20:27:40 +0100 Subject: [PATCH 8/8] Fix GH link path --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 3725df43..89e1809f 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -148,7 +148,7 @@ "display_github": True, "github_user": "python-escpos", "github_repo": "python-escpos", - "github_version": "master/", + "github_version": "master/doc/", } # Add any paths that contain custom themes here, relative to this directory.