semiFIX image-printing (still broken)
This commit is contained in:
parent
bda7f85346
commit
18518fa901
|
@ -10,6 +10,11 @@ moved to `capabilities` as in `escpos-php by @mike42 <https://github.com/mike42/
|
|||
:license: GNU GPL v3
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
#from __future__ import unicode_literals
|
||||
|
||||
# Control characters
|
||||
# as labelled in http://www.novopos.ch/client/EPSON/TM-T20/TM-T20_eng_qr.pdf
|
||||
NUL = '\x00'
|
||||
|
|
|
@ -9,6 +9,11 @@ This module contains the abstract base class :py:class:`Escpos`.
|
|||
:license: GNU GPL v3
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
#from __future__ import unicode_literals
|
||||
|
||||
try:
|
||||
import Image
|
||||
except ImportError:
|
||||
|
@ -63,9 +68,9 @@ class Escpos(object):
|
|||
else:
|
||||
image_border = 32 - (size % 32)
|
||||
if (image_border % 2) == 0:
|
||||
return round(image_border / 2), round(image_border / 2)
|
||||
return image_border // 2, image_border // 2
|
||||
else:
|
||||
return round(image_border / 2), round((image_border / 2) + 1)
|
||||
return image_border // 2, (image_border // 2) + 1
|
||||
|
||||
def _print_image(self, line, size):
|
||||
""" Print formatted image
|
||||
|
|
|
@ -20,6 +20,11 @@ Result/Exit codes:
|
|||
:license: GNU GPL v3
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
#from __future__ import unicode_literals
|
||||
|
||||
|
||||
class Error(Exception):
|
||||
""" Base class for ESC/POS errors """
|
||||
|
|
|
@ -7,6 +7,11 @@
|
|||
:license: GNU GPL v3
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
#from __future__ import unicode_literals
|
||||
|
||||
import usb.core
|
||||
import usb.util
|
||||
import serial
|
||||
|
|
Loading…
Reference in New Issue