fix(label): Try another way to serialize
This commit is contained in:
parent
536d27d272
commit
b52ee09b90
3 changed files with 3 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -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
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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')
|
||||||
|
|
Loading…
Add table
Reference in a new issue