[FIX] hw_escpos: use logger instead of prints to avoid corrupting the odoo.py command line interface.

This commit is contained in:
Frederic van der Essen
2014-11-18 19:03:20 +01:00
parent 0b2ee16885
commit 6111cf9873
+10 -6
View File
@@ -6,11 +6,8 @@
@license: GPL
'''
try:
import qrcode
except ImportError:
qrcode = None
import logging
import time
import copy
import io
@@ -24,12 +21,19 @@ import xml.dom.minidom as minidom
from PIL import Image
_logger = logging.getLogger(__name__)
try:
import jcconv
except ImportError:
jcconv = None
print 'ESC/POS: please install jcconv for improved Japanese receipt printing:'
print ' # pip install jcconv'
_logger.warning('ESC/POS: please install jcconv for improved Japanese receipt printing:\n # pip install jcconv')
try:
import qrcode
except ImportError:
qrcode = None
_logger.warning('ESC/POS: please install the qrcode python module for qrcode printing in point of sale receipts:\n # pip install qrcode')
from constants import *
from exceptions import *