refactor: simplified expressions, remove unused import

This commit is contained in:
Patrick Kanzler 2016-06-19 11:51:52 +02:00
parent adf73f3790
commit e814396bd8
4 changed files with 5 additions and 7 deletions

View File

@ -196,7 +196,7 @@ class Escpos(object):
outp = b''
for _ in range(0, out_bytes):
outp += six.int2byte(inp_number % 256)
inp_number = inp_number // 256
inp_number //= 256
return outp
def charcode(self, code):
@ -481,12 +481,12 @@ class Escpos(object):
else:
raise SetVariableError()
# Upside down
if flip == True:
if flip:
self._raw(TXT_FLIP_ON)
else:
self._raw(TXT_FLIP_OFF)
# Smoothing
if smooth == True:
if smooth:
self._raw(TXT_SMOOTH_ON)
else:
self._raw(TXT_SMOOTH_OFF)

View File

@ -277,8 +277,6 @@ class Dummy(Escpos):
def __init__(self, *args, **kwargs):
"""
:param devfile : Device file under dev filesystem
"""
Escpos.__init__(self, *args, **kwargs)
self._output_list = []

View File

@ -54,4 +54,4 @@ def _load_and_check_img(filename, width_expected, height_expected, raster_format
i = 0
for row in im.to_column_format(False):
assert(row == column_format_expected[i])
i = i + 1
i += 1

View File

@ -14,7 +14,7 @@ from __future__ import unicode_literals
import escpos.printer as printer
import escpos.escpos as escpos
import os
def test_with_statement():
"""Use with statement"""