fix(label): Try another way to serialize

This commit is contained in:
Andreas Mieke 2024-04-18 00:44:12 -04:00
parent 536d27d272
commit b52ee09b90
Signed by: zenermerps
SSH key fingerprint: SHA256:Ne+hwc5QIgYlqCuLZ0LV3301Wo/p8UoGOrGC+T6S0t8
3 changed files with 3 additions and 3 deletions

2
.gitignore vendored
View file

@ -2,7 +2,7 @@
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,python,visualstudiocode # Edit at https://www.toptal.com/developers/gitignore?templates=macos,python,visualstudiocode
# File generated by test server # File generated by test server
test.png test.*
### macOS ### ### macOS ###
# General # General

View file

@ -40,7 +40,7 @@ class PhomemoLabelPlugin(LabelPrintingMixin, SettingsMixin, InvenTreePlugin):
# Read settings # Read settings
ip_address = self.get_setting('IP_ADDRESS') ip_address = self.get_setting('IP_ADDRESS')
port = int(self.get_setting('PORT')) 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 # Send the label to the printer
try: try:

View file

@ -11,7 +11,7 @@ s.listen(1)
while True: while True:
conn, addr = s.accept() conn, addr = s.accept()
print(addr) print(addr)
printer = open('test.json', 'w') printer = open('test.json', 'wb')
while True: while True:
data = conn.recv(91000) data = conn.recv(91000)
print('data received') print('data received')