def print_zpl_socket(zpl_text, host=settings.BCPRINTER_PRINTER1_HOST, port=settings.BCPRINTER_PRINTER1_PORT):
"""
Sends zpl_text to printer via a socket
+
+ if zpl_text is a list of zpl_texts, it will print each one
+ in that list.
"""
+
+ # Process anyway if zpl_text is a list.
+ if type(zpl_text) is list:
+ zpl_text = '\n'.join(zpl_text)
+
s = socket.socket()
# PORT 9100 is default for Zebra tabletop/desktop printers
# PORT 6101 is default for Zebra mobile printers