diff --git a/printer_zpl2/README.rst b/printer_zpl2/README.rst index a483e351cb7..0b23636a641 100644 --- a/printer_zpl2/README.rst +++ b/printer_zpl2/README.rst @@ -17,22 +17,23 @@ Printer ZPL II :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freport--print--send-lightgray.png?logo=github - :target: https://github.com/OCA/report-print-send/tree/16.0/printer_zpl2 + :target: https://github.com/OCA/report-print-send/tree/17.0/printer_zpl2 :alt: OCA/report-print-send .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/report-print-send-16-0/report-print-send-16-0-printer_zpl2 + :target: https://translation.odoo-community.org/projects/report-print-send-17-0/report-print-send-17-0-printer_zpl2 :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/report-print-send&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/report-print-send&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| -This module extends the **Report to printer** (``base_report_to_printer``) -module to add a ZPL II label printing feature. +This module extends the **Report to printer** +(``base_report_to_printer``) module to add a ZPL II label printing +feature. -This module is meant to be used as a base for module development, and does not provide a GUI on its own. -See below for more details. +This module is meant to be used as a base for module development, and +does not provide a GUI on its own. See below for more details. **Table of contents** @@ -49,50 +50,58 @@ Configuration To configure this module, you need to: -#. Go to *Settings > Printing > Labels > ZPL II* -#. Create new labels -#. Import ZPL2 code -#. Use the Test Mode tab during the creation +1. Go to *Settings > Printing > Labels > ZPL II* +2. Create new labels +3. Import ZPL2 code +4. Use the Test Mode tab during the creation -It's also possible to add a label printing wizard on any model by creating a new *ir.actions.act_window* record. -For example, to add the printing wizard on the *product.product* model :: +It's also possible to add a label printing wizard on any model by +creating a new *ir.actions.act_window* record. For example, to add the +printing wizard on the *product.product* model : - +:: + + Usage ===== -To print a label, you need to call use the label printing method from anywhere (other modules, server actions, etc.). +To print a label, you need to call use the label printing method from +anywhere (other modules, server actions, etc.). + +Example : Print the label of a product : + +:: -Example : Print the label of a product :: + self.env['printing.label.zpl2'].browse(label_id).print_label( + self.env['printing.printer'].browse(printer_id), + self.env['product.product'].browse(product_id)) - self.env['printing.label.zpl2'].browse(label_id).print_label( - self.env['printing.printer'].browse(printer_id), - self.env['product.product'].browse(product_id)) +You can also use the generic label printing wizard, if added on some +models. -You can also use the generic label printing wizard, if added on some models. +|Try me on Runbot| -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot +.. |Try me on Runbot| image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :target: https://runbot.odoo-community.org/runbot/144/12.0 Changelog ========= 13.0.1.0.0 (2019-09-30) -~~~~~~~~~~~~~~~~~~~~~~~ +----------------------- -* [RELEASE] Port from V12. -* Selection lists do not support integers any longer -* Binary field now returns False when empty instead of none, - change tests to reflect this -* work around an appels vs oranges warning +- [RELEASE] Port from V12. +- Selection lists do not support integers any longer +- Binary field now returns False when empty instead of none, change + tests to reflect this +- work around an appels vs oranges warning Bug Tracker =========== @@ -100,7 +109,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -108,25 +117,25 @@ Credits ======= Authors -~~~~~~~ +------- * SUBTENO-IT * FLorent de Labarre * Apertoso NV Contributors -~~~~~~~~~~~~ +------------ -* Sylvain Garancher -* Florent de Labarre -* Jos De Graeve -* Rod Schouteden -* Miquel Raïch -* Lois Rilo -* Tran Quoc Duong +- Sylvain Garancher +- Florent de Labarre +- Jos De Graeve +- Rod Schouteden +- Miquel Raïch +- Lois Rilo +- Tran Quoc Duong Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -138,6 +147,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/report-print-send `_ project on GitHub. +This module is part of the `OCA/report-print-send `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/printer_zpl2/models/printing_label_zpl2.py b/printer_zpl2/models/printing_label_zpl2.py index 44152f23a40..f19fec041c3 100644 --- a/printer_zpl2/models/printing_label_zpl2.py +++ b/printer_zpl2/models/printing_label_zpl2.py @@ -133,7 +133,7 @@ def _get_to_data_to_print( page_count=1, label_offset_x=0, label_offset_y=0, - **extra + **extra, ): to_print = [] for component in self.component_ids: @@ -200,13 +200,13 @@ def _generate_zpl2_components_data( page_count=1, label_offset_x=0, label_offset_y=0, - **extra + **extra, ): to_print = self._get_to_data_to_print( record, page_number, page_count, label_offset_x, label_offset_y, **extra ) - for (component, data, offset_x, offset_y) in to_print: + for component, data, offset_x, offset_y in to_print: component_offset_x = component.origin_x + offset_x component_offset_y = component.origin_y + offset_y if component.component_type == "text": @@ -307,7 +307,7 @@ def _generate_zpl2_components_data( else: if component.component_type == zpl2.BARCODE_QR_CODE: # Adding Control Arguments to QRCode data Label - data = "{}A,{}".format(component.error_correction, data) + data = f"{component.error_correction}A,{data}" barcode_arguments = { field_name: component[field_name] @@ -356,7 +356,7 @@ def _generate_zpl2_data(self, record, page_count=1, **extra): record, page_number=page_number, page_count=page_count, - **extra + **extra, ) # Restore printer's configuration and end the label diff --git a/printer_zpl2/models/zpl2.py b/printer_zpl2/models/zpl2.py index d9600b62339..7d9e7f87a9b 100644 --- a/printer_zpl2/models/zpl2.py +++ b/printer_zpl2/models/zpl2.py @@ -106,7 +106,7 @@ BARCODE_QR_CODE = "qr_code" -class Zpl2(object): +class Zpl2: """ZPL II management class Allows to generate data for Zebra printers """ @@ -358,11 +358,7 @@ def _field_data_stop(self): def _field_data(self, data): """Add data to the buffer, between start and stop commands""" - command = "{start}{data}{stop}".format( - start=self._field_data_start(), - data=data, - stop=self._field_data_stop(), - ) + command = f"{self._field_data_start()}{data}{self._field_data_stop()}" return command def font_data(self, right, down, field_format, data): @@ -500,11 +496,7 @@ def graphic_field(self, right, down, pil_image): bytes_per_row = rounded_width / 8 total_bytes = bytes_per_row * height graphic_image_command = ( - "^GFA,{total_bytes},{total_bytes},{bytes_per_row},{ascii_data}".format( - total_bytes=total_bytes, - bytes_per_row=bytes_per_row, - ascii_data=ascii_data, - ) + f"^GFA,{total_bytes},{total_bytes},{bytes_per_row},{ascii_data}" ) # Generate the ZPL II command command = "{origin}{data}{stop}".format( diff --git a/printer_zpl2/pyproject.toml b/printer_zpl2/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/printer_zpl2/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/printer_zpl2/readme/CONFIGURE.rst b/printer_zpl2/readme/CONFIGURE.md similarity index 55% rename from printer_zpl2/readme/CONFIGURE.rst rename to printer_zpl2/readme/CONFIGURE.md index 2a3036e1690..8b507f8a5a9 100644 --- a/printer_zpl2/readme/CONFIGURE.rst +++ b/printer_zpl2/readme/CONFIGURE.md @@ -1,12 +1,13 @@ To configure this module, you need to: -#. Go to *Settings > Printing > Labels > ZPL II* -#. Create new labels -#. Import ZPL2 code -#. Use the Test Mode tab during the creation +1. Go to *Settings \> Printing \> Labels \> ZPL II* +2. Create new labels +3. Import ZPL2 code +4. Use the Test Mode tab during the creation -It's also possible to add a label printing wizard on any model by creating a new *ir.actions.act_window* record. -For example, to add the printing wizard on the *product.product* model :: +It's also possible to add a label printing wizard on any model by +creating a new *ir.actions.act_window* record. For example, to add the +printing wizard on the *product.product* model : \> +- Florent de Labarre +- Jos De Graeve \<\> +- Rod Schouteden \<\> +- Miquel Raïch \<\> +- Lois Rilo \<\> +- Tran Quoc Duong \<\> diff --git a/printer_zpl2/readme/CONTRIBUTORS.rst b/printer_zpl2/readme/CONTRIBUTORS.rst deleted file mode 100644 index b6a2bf923b6..00000000000 --- a/printer_zpl2/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,7 +0,0 @@ -* Sylvain Garancher -* Florent de Labarre -* Jos De Graeve -* Rod Schouteden -* Miquel Raïch -* Lois Rilo -* Tran Quoc Duong diff --git a/printer_zpl2/readme/DESCRIPTION.md b/printer_zpl2/readme/DESCRIPTION.md new file mode 100644 index 00000000000..ff8a5eacb24 --- /dev/null +++ b/printer_zpl2/readme/DESCRIPTION.md @@ -0,0 +1,5 @@ +This module extends the **Report to printer** (`base_report_to_printer`) +module to add a ZPL II label printing feature. + +This module is meant to be used as a base for module development, and +does not provide a GUI on its own. See below for more details. diff --git a/printer_zpl2/readme/DESCRIPTION.rst b/printer_zpl2/readme/DESCRIPTION.rst deleted file mode 100644 index 3dbd00407e3..00000000000 --- a/printer_zpl2/readme/DESCRIPTION.rst +++ /dev/null @@ -1,5 +0,0 @@ -This module extends the **Report to printer** (``base_report_to_printer``) -module to add a ZPL II label printing feature. - -This module is meant to be used as a base for module development, and does not provide a GUI on its own. -See below for more details. diff --git a/printer_zpl2/readme/HISTORY.md b/printer_zpl2/readme/HISTORY.md new file mode 100644 index 00000000000..84073872826 --- /dev/null +++ b/printer_zpl2/readme/HISTORY.md @@ -0,0 +1,7 @@ +## 13.0.1.0.0 (2019-09-30) + +- \[RELEASE\] Port from V12. +- Selection lists do not support integers any longer +- Binary field now returns False when empty instead of none, change + tests to reflect this +- work around an appels vs oranges warning diff --git a/printer_zpl2/readme/HISTORY.rst b/printer_zpl2/readme/HISTORY.rst deleted file mode 100644 index 70679154798..00000000000 --- a/printer_zpl2/readme/HISTORY.rst +++ /dev/null @@ -1,8 +0,0 @@ -13.0.1.0.0 (2019-09-30) -~~~~~~~~~~~~~~~~~~~~~~~ - -* [RELEASE] Port from V12. -* Selection lists do not support integers any longer -* Binary field now returns False when empty instead of none, - change tests to reflect this -* work around an appels vs oranges warning diff --git a/printer_zpl2/readme/INSTALL.rst b/printer_zpl2/readme/INSTALL.md similarity index 100% rename from printer_zpl2/readme/INSTALL.rst rename to printer_zpl2/readme/INSTALL.md diff --git a/printer_zpl2/readme/USAGE.rst b/printer_zpl2/readme/USAGE.md similarity index 52% rename from printer_zpl2/readme/USAGE.rst rename to printer_zpl2/readme/USAGE.md index cfbe9a9cbcf..5cd42c8c424 100644 --- a/printer_zpl2/readme/USAGE.rst +++ b/printer_zpl2/readme/USAGE.md @@ -1,13 +1,13 @@ -To print a label, you need to call use the label printing method from anywhere (other modules, server actions, etc.). +To print a label, you need to call use the label printing method from +anywhere (other modules, server actions, etc.). -Example : Print the label of a product :: +Example : Print the label of a product : self.env['printing.label.zpl2'].browse(label_id).print_label( self.env['printing.printer'].browse(printer_id), self.env['product.product'].browse(product_id)) -You can also use the generic label printing wizard, if added on some models. +You can also use the generic label printing wizard, if added on some +models. -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/144/12.0 +[![Try me on Runbot](https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas)](https://runbot.odoo-community.org/runbot/144/12.0) diff --git a/printer_zpl2/static/description/index.html b/printer_zpl2/static/description/index.html index 82599126c33..c01084ba26c 100644 --- a/printer_zpl2/static/description/index.html +++ b/printer_zpl2/static/description/index.html @@ -369,11 +369,12 @@

Printer ZPL II

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:c4defaa600d7e33cad7033338f5db25c205cd873afc0a5fd1aaa7658c7c4e3d7 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/report-print-send Translate me on Weblate Try me on Runboat

-

This module extends the Report to printer (base_report_to_printer) -module to add a ZPL II label printing feature.

-

This module is meant to be used as a base for module development, and does not provide a GUI on its own. -See below for more details.

+

Beta License: AGPL-3 OCA/report-print-send Translate me on Weblate Try me on Runboat

+

This module extends the Report to printer +(base_report_to_printer) module to add a ZPL II label printing +feature.

+

This module is meant to be used as a base for module development, and +does not provide a GUI on its own. See below for more details.

Table of contents

    @@ -406,8 +407,9 @@

    Configuration

  • Import ZPL2 code
  • Use the Test Mode tab during the creation
  • -

    It’s also possible to add a label printing wizard on any model by creating a new ir.actions.act_window record. -For example, to add the printing wizard on the product.product model

    +

    It’s also possible to add a label printing wizard on any model by +creating a new ir.actions.act_window record. For example, to add the +printing wizard on the product.product model :

     <act_window id="action_wizard_purchase"
       name="Print Label"
    @@ -420,15 +422,17 @@ 

    Configuration

Usage

-

To print a label, you need to call use the label printing method from anywhere (other modules, server actions, etc.).

-

Example : Print the label of a product

+

To print a label, you need to call use the label printing method from +anywhere (other modules, server actions, etc.).

+

Example : Print the label of a product :

 self.env['printing.label.zpl2'].browse(label_id).print_label(
     self.env['printing.printer'].browse(printer_id),
     self.env['product.product'].browse(product_id))
 
-

You can also use the generic label printing wizard, if added on some models.

-Try me on Runbot +

You can also use the generic label printing wizard, if added on some +models.

+

Try me on Runbot

Changelog

@@ -437,8 +441,8 @@

13.0.1.0.0 (2019-09-30)

  • [RELEASE] Port from V12.
  • Selection lists do not support integers any longer
  • -
  • Binary field now returns False when empty instead of none, -change tests to reflect this
  • +
  • Binary field now returns False when empty instead of none, change +tests to reflect this
  • work around an appels vs oranges warning
@@ -448,7 +452,7 @@

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -480,7 +484,7 @@

Maintainers

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

This module is part of the OCA/report-print-send project on GitHub.

+

This module is part of the OCA/report-print-send project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/printer_zpl2/tests/test_printing_label_zpl2.py b/printer_zpl2/tests/test_printing_label_zpl2.py index abf5d3d1791..68f3931574c 100644 --- a/printer_zpl2/tests/test_printing_label_zpl2.py +++ b/printer_zpl2/tests/test_printing_label_zpl2.py @@ -117,13 +117,13 @@ def test_sublabel_label_contents(self): # Sublabel component format "^A0N,10,10" # Sublabel component contents - "^FD{contents}" + f"^FD{data}" # Sublabel component end "^FS\n" # Recall last saved parameters "^JUR\n" # Label end - "^XZ".format(contents=data), + "^XZ", ) def test_repeatable_component_label_fixed_contents(self): @@ -160,7 +160,7 @@ def test_repeatable_component_label_fixed_contents(self): # First component format "^A0N,10,10" # First component contents - "^FD{contents}" + f"^FD{data}" # First component end "^FS\n" # Second component position @@ -168,7 +168,7 @@ def test_repeatable_component_label_fixed_contents(self): # Second component format "^A0N,10,10" # Second component contents - "^FD{contents}" + f"^FD{data}" # Second component end "^FS\n" # Third component position @@ -176,13 +176,13 @@ def test_repeatable_component_label_fixed_contents(self): # Third component format "^A0N,10,10" # Third component contents - "^FD{contents}" + f"^FD{data}" # Third component end "^FS\n" # Recall last saved parameters "^JUR\n" # Label end - "^XZ".format(contents=data), + "^XZ", ) def test_repeatable_component_label_iterable_contents(self): @@ -222,7 +222,7 @@ def test_repeatable_component_label_iterable_contents(self): # First component format "^A0N,10,10" # First component contents - "^FD{contents[1]}" + f"^FD{data[1]}" # First component end "^FS\n" # Second component position @@ -230,13 +230,13 @@ def test_repeatable_component_label_iterable_contents(self): # Second component format "^A0N,10,10" # Second component contents - "^FD{contents[2]}" + f"^FD{data[2]}" # Second component end "^FS\n" # Recall last saved parameters "^JUR\n" # Label end - "^XZ".format(contents=data), + "^XZ", ) def test_repeatable_component_label_iterable_offset(self): @@ -249,7 +249,7 @@ def test_repeatable_component_label_iterable_offset(self): label = self.new_label( {"model_id": self.env.ref("printer_zpl2.model_printing_label_zpl2").id} ) - data = ["Text {value}".format(value=ind) for ind in range(20)] + data = [f"Text {ind}" for ind in range(20)] self.new_component( { "label_id": label.id, @@ -276,7 +276,7 @@ def test_repeatable_component_label_iterable_offset(self): # First component format "^A0N,10,10" # First component contents - "^FD{contents[10]}" + f"^FD{data[10]}" # First component end "^FS\n" # Second component position @@ -284,7 +284,7 @@ def test_repeatable_component_label_iterable_offset(self): # Second component format "^A0N,10,10" # Second component contents - "^FD{contents[11]}" + f"^FD{data[11]}" # Second component end "^FS\n" # Third component position @@ -292,13 +292,13 @@ def test_repeatable_component_label_iterable_offset(self): # Third component format "^A0N,10,10" # Third component contents - "^FD{contents[12]}" + f"^FD{data[12]}" # Third component end "^FS\n" # Recall last saved parameters "^JUR\n" # Label end - "^XZ".format(contents=data), + "^XZ", ) def test_repeatable_sublabel_contents(self): @@ -358,7 +358,7 @@ def test_repeatable_sublabel_contents(self): # Label name component format "^A0N,10,10" # Label name component contents - "^FD{label.name}" + f"^FD{label.name}" # Label name component end "^FS\n" # First component name component position @@ -366,7 +366,7 @@ def test_repeatable_sublabel_contents(self): # First component name component format "^A0N,10,10" # First component name component contents - "^FD{label.component_ids[0].name}" + f"^FD{label.component_ids[0].name}" # First component name component end "^FS\n" # First component data component position @@ -374,7 +374,7 @@ def test_repeatable_sublabel_contents(self): # First component data component format "^A0N,10,10" # First component data component contents - "^FD{label.component_ids[0].data}" + f"^FD{label.component_ids[0].data}" # First component data component end "^FS\n" # Second component name component position @@ -382,7 +382,7 @@ def test_repeatable_sublabel_contents(self): # Second component name component format "^A0N,10,10" # Second component name component contents - "^FD{label.component_ids[1].name}" + f"^FD{label.component_ids[1].name}" # Second component name component end "^FS\n" # Second component data component position @@ -390,13 +390,13 @@ def test_repeatable_sublabel_contents(self): # Second component data component format "^A0N,10,10" # Second component data component contents - "^FD{label.component_ids[1].data}" + f"^FD{label.component_ids[1].data}" # Second component data component end "^FS\n" # Recall last saved parameters "^JUR\n" # Label end - "^XZ".format(label=label), + "^XZ", ) def test_text_label_contents(self): @@ -420,13 +420,13 @@ def test_text_label_contents(self): # Component format "^A0N,10,10" # Component contents - "^FD{contents}" + f"^FD{data}" # Component end "^FS\n" # Recall last saved parameters "^JUR\n" # Label end - "^XZ".format(contents=data), + "^XZ", ) def test_reversed_text_label_contents(self): @@ -454,13 +454,13 @@ def test_reversed_text_label_contents(self): # Reverse print argument "^FR" # Component contents - "^FD{contents}" + f"^FD{data}" # Component end "^FS\n" # Recall last saved parameters "^JUR\n" # Label end - "^XZ".format(contents=data), + "^XZ", ) def test_block_text_label_contents(self): @@ -488,13 +488,13 @@ def test_block_text_label_contents(self): # Block definition "^FB0,1,0,L,0" # Component contents - "^FD{contents}" + f"^FD{data}" # Component end "^FS\n" # Recall last saved parameters "^JUR\n" # Label end - "^XZ".format(contents=data), + "^XZ", ) def test_rectangle_label_contents(self): @@ -607,13 +607,13 @@ def test_code11_barcode_label_contents(self): # Component format "^B1N,N,0,N,N" # Component contents - "^FD{contents}" + f"^FD{data}" # Component end "^FS\n" # Recall last saved parameters "^JUR\n" # Label end - "^XZ".format(contents=data), + "^XZ", ) def test_2of5_barcode_label_contents(self): @@ -645,13 +645,13 @@ def test_2of5_barcode_label_contents(self): # Component format "^B2N,0,N,N,N" # Component contents - "^FD{contents}" + f"^FD{data}" # Component end "^FS\n" # Recall last saved parameters "^JUR\n" # Label end - "^XZ".format(contents=data), + "^XZ", ) def test_code39_barcode_label_contents(self): @@ -683,13 +683,13 @@ def test_code39_barcode_label_contents(self): # Component format "^B3N,N,0,N,N" # Component contents - "^FD{contents}" + f"^FD{data}" # Component end "^FS\n" # Recall last saved parameters "^JUR\n" # Label end - "^XZ".format(contents=data), + "^XZ", ) def test_code49_barcode_label_contents(self): @@ -721,13 +721,13 @@ def test_code49_barcode_label_contents(self): # Component format "^B4N,0,N" # Component contents - "^FD{contents}" + f"^FD{data}" # Component end "^FS\n" # Recall last saved parameters "^JUR\n" # Label end - "^XZ".format(contents=data), + "^XZ", ) def test_code49_barcode_label_contents_line(self): @@ -760,13 +760,13 @@ def test_code49_barcode_label_contents_line(self): # Component format "^B4N,0,B" # Component contents - "^FD{contents}" + f"^FD{data}" # Component end "^FS\n" # Recall last saved parameters "^JUR\n" # Label end - "^XZ".format(contents=data), + "^XZ", ) def test_code49_barcode_label_contents_with_above(self): @@ -802,13 +802,13 @@ def test_code49_barcode_label_contents_with_above(self): # Component format "^B4N,0,A" # Component contents - "^FD{contents}" + f"^FD{data}" # Component end "^FS\n" # Recall last saved parameters "^JUR\n" # Label end - "^XZ".format(contents=data), + "^XZ", ) def test_pdf417_barcode_label_contents(self): @@ -836,13 +836,13 @@ def test_pdf417_barcode_label_contents(self): # Component format "^B7N,0,0,0,0,N" # Component contents - "^FD{contents}" + f"^FD{data}" # Component end "^FS\n" # Recall last saved parameters "^JUR\n" # Label end - "^XZ".format(contents=data), + "^XZ", ) def test_ean8_barcode_label_contents(self): @@ -870,13 +870,13 @@ def test_ean8_barcode_label_contents(self): # Component format "^B8N,0,N,N" # Component contents - "^FD{contents}" + f"^FD{data}" # Component end "^FS\n" # Recall last saved parameters "^JUR\n" # Label end - "^XZ".format(contents=data), + "^XZ", ) def test_upce_barcode_label_contents(self): @@ -904,13 +904,13 @@ def test_upce_barcode_label_contents(self): # Component format "^B9N,0,N,N,N" # Component contents - "^FD{contents}" + f"^FD{data}" # Component end "^FS\n" # Recall last saved parameters "^JUR\n" # Label end - "^XZ".format(contents=data), + "^XZ", ) def test_code128_barcode_label_contents(self): @@ -942,13 +942,13 @@ def test_code128_barcode_label_contents(self): # Component format "^BCN,0,N,N,N" # Component contents - "^FD{contents}" + f"^FD{data}" # Component end "^FS\n" # Recall last saved parameters "^JUR\n" # Label end - "^XZ".format(contents=data), + "^XZ", ) def test_ean13_barcode_label_contents(self): @@ -976,13 +976,13 @@ def test_ean13_barcode_label_contents(self): # Component format "^BEN,0,N,N" # Component contents - "^FD{contents}" + f"^FD{data}" # Component end "^FS\n" # Recall last saved parameters "^JUR\n" # Label end - "^XZ".format(contents=data), + "^XZ", ) def test_qrcode_barcode_label_contents(self): @@ -1014,13 +1014,13 @@ def test_qrcode_barcode_label_contents(self): # Component format "^BQN,2,1,Q,7" # Component contents - "^FDQA,{contents}" + f"^FDQA,{data}" # Component end "^FS\n" # Recall last saved parameters "^JUR\n" # Label end - "^XZ".format(contents=data), + "^XZ", ) def test_graphic_label_contents_blank(self):