From b52ee09b90d10b4de157b34b55a621c54593ccec Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Thu, 18 Apr 2024 00:44:12 -0400 Subject: [PATCH] fix(label): Try another way to serialize --- .gitignore | 2 +- inventree_phomemo/phomemo_label.py | 2 +- inventree_phomemo/server.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 8997141..8e78007 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ # Edit at https://www.toptal.com/developers/gitignore?templates=macos,python,visualstudiocode # File generated by test server -test.png +test.* ### macOS ### # General diff --git a/inventree_phomemo/phomemo_label.py b/inventree_phomemo/phomemo_label.py index 180b841..d4c093e 100644 --- a/inventree_phomemo/phomemo_label.py +++ b/inventree_phomemo/phomemo_label.py @@ -40,7 +40,7 @@ class PhomemoLabelPlugin(LabelPrintingMixin, SettingsMixin, InvenTreePlugin): # Read settings ip_address = self.get_setting('IP_ADDRESS') port = int(self.get_setting('PORT')) - label_data = kwargs['label_instance'] + label_data = kwargs['label_instance'].object_to_print # Send the label to the printer try: diff --git a/inventree_phomemo/server.py b/inventree_phomemo/server.py index c0efce9..6e889a8 100644 --- a/inventree_phomemo/server.py +++ b/inventree_phomemo/server.py @@ -11,7 +11,7 @@ s.listen(1) while True: conn, addr = s.accept() print(addr) - printer = open('test.json', 'w') + printer = open('test.json', 'wb') while True: data = conn.recv(91000) print('data received')