From bb329b093bb5da1ffb8610474aa5996408199691 Mon Sep 17 00:00:00 2001 From: Manuel F Martinez Date: Thu, 4 Jun 2015 14:44:02 -0700 Subject: [PATCH 1/9] Updated URL for the documentation --- README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README b/README index a60323e..be876ba 100644 --- a/README +++ b/README @@ -82,8 +82,8 @@ The following example shows how to initialize the Epson TM-TI88IV ------------------------------------------------------------------ 5. Links -Please visit project homepage at: -http://repo.bashlinux.com/projects/escpos.html +Please visit project documentation at: +https://github.com/manpaz/python-escpos/tree/wiki Manuel F Martinez From 47aa4a96c91253bca264aa22ceb687df12e0c2ae Mon Sep 17 00:00:00 2001 From: Manuel F Martinez Date: Thu, 4 Jun 2015 15:20:15 -0700 Subject: [PATCH 2/9] Updated documentation URL to local wiki --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index be876ba..317687b 100644 --- a/README +++ b/README @@ -83,7 +83,7 @@ The following example shows how to initialize the Epson TM-TI88IV 5. Links Please visit project documentation at: -https://github.com/manpaz/python-escpos/tree/wiki +https://github.com/manpaz/python-escpos/wiki Manuel F Martinez From e623799fd716b0c85fc5860d3fae3e49c2cc4713 Mon Sep 17 00:00:00 2001 From: Manuel F Martinez Date: Thu, 4 Jun 2015 15:55:14 -0700 Subject: [PATCH 3/9] Updated setup URLs --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 7c2766a..7ceeb26 100755 --- a/setup.py +++ b/setup.py @@ -5,8 +5,8 @@ from distutils.core import setup setup( name='escpos', version='1.0-4', - url='http://code.google.com/p/python-escpos', - download_url='http://python-escpos.googlecode.com/files/python-escpos-1.0.zip', + url='https://github.com/manpaz/python-escpos', + download_url='https://github.com/manpaz/python-escpos.git', description='Python library to manipulate ESC/POS Printers', license='GNU GPL v3', long_description=open('README').read(), From 9550ad1068c4b3ef2710a0596c90d0483d4734e5 Mon Sep 17 00:00:00 2001 From: Manuel F Martinez Date: Wed, 10 Jun 2015 16:28:27 -0700 Subject: [PATCH 4/9] Fixed License version mismatch --- escpos/escpos.py | 2 +- escpos/printer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/escpos/escpos.py b/escpos/escpos.py index b6befdd..b2e91f7 100644 --- a/escpos/escpos.py +++ b/escpos/escpos.py @@ -3,7 +3,7 @@ @author: Manuel F Martinez @organization: Bashlinux @copyright: Copyright (c) 2012 Bashlinux -@license: GPL +@license: GNU GPL v3 """ try: diff --git a/escpos/printer.py b/escpos/printer.py index a34edb4..d60e880 100644 --- a/escpos/printer.py +++ b/escpos/printer.py @@ -3,7 +3,7 @@ @author: Manuel F Martinez @organization: Bashlinux @copyright: Copyright (c) 2012 Bashlinux -@license: GPL +@license: GNU GPL v3 """ import usb.core From cae02976a3f0096d910515526f1a43a6efd3096e Mon Sep 17 00:00:00 2001 From: Manuel F Martinez Date: Tue, 30 Jun 2015 15:09:08 -0700 Subject: [PATCH 5/9] Updated accordingly to the wiki --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 317687b..80c4867 100644 --- a/README +++ b/README @@ -72,7 +72,7 @@ The following example shows how to initialize the Epson TM-TI88IV from escpos import * """ Seiko Epson Corp. Receipt Printer M129 Definitions (EPSON TM-T88IV) """ - Epson = escpos.Escpos(0x04b8,0x0202,0) + Epson = escpos.Escpos(0x04b8,0x0202) Epson.text("Hello World") Epson.image("logo.gif") Epson.barcode From f0f84e1215d7722136ebd2575aed2e8181002a16 Mon Sep 17 00:00:00 2001 From: ldos Date: Sat, 4 Jul 2015 17:23:31 +0200 Subject: [PATCH 6/9] Extended params for serial printers Update printer.Serial() constructor and its open() method to extend serial params. Backwards compatible, no client modifications needed. --- escpos/printer.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/escpos/printer.py b/escpos/printer.py index d60e880..738d7ca 100644 --- a/escpos/printer.py +++ b/escpos/printer.py @@ -69,23 +69,39 @@ class Usb(Escpos): class Serial(Escpos): """ Define Serial printer """ - def __init__(self, devfile="/dev/ttyS0", baudrate=9600, bytesize=8, timeout=1): + def __init__(self, devfile="/dev/ttyS0", baudrate=9600, bytesize=8, timeout=1, + parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, + xonxoff=False , dsrdtr=True): """ @param devfile : Device file under dev filesystem @param baudrate : Baud rate for serial transmission @param bytesize : Serial buffer size @param timeout : Read/Write timeout + + @param parity : Parity checking + @param stopbits : Number of stop bits + @param xonxoff : Software flow control + @param dsrdtr : Hardware flow control (False to enable RTS/CTS) """ self.devfile = devfile self.baudrate = baudrate self.bytesize = bytesize self.timeout = timeout + + self.parity = parity + self.stopbits = stopbits + self.xonxoff = xonxoff + self.dsrdtr = dsrdtr + self.open() def open(self): """ Setup serial port and set is as escpos device """ - self.device = serial.Serial(port=self.devfile, baudrate=self.baudrate, bytesize=self.bytesize, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=self.timeout, dsrdtr=True) + self.device = serial.Serial(port=self.devfile, baudrate=self.baudrate, + bytesize=self.bytesize, parity=self.parity, + stopbits=self.stopbits, timeout=self.timeout, + xonxoff=self.xonxoff, dsrdtr=self.dsrdtr) if self.device is not None: print "Serial printer enabled" From 280000d6eda6c6c7aa5721cb79d0a92a5e16c203 Mon Sep 17 00:00:00 2001 From: Manuel F Martinez Date: Sat, 22 Aug 2015 12:43:09 -0700 Subject: [PATCH 7/9] Fixed issues with transparent images --- CHANGELOG | 13 +++++++++++++ escpos/escpos.py | 11 ++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index d137f7e..05cc9da 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -22,3 +22,16 @@ CHANGELOG - Added charcode tables - Fixed Horizontal Tab - Fixed code tabulators + +* 2015-04-21 - Version 1.0.5 +- Merge pull request #45 from Krispy2009/master + . Raising the right error when wrong charcode is used + . Sent by Krispy2009@gmail.com + +* 2015-07-06 - Version 1.0.6 +- Merge pull request #53 from ldos/master + . Extended params for serial printers + . Sent by cafeteria.ldosalzira@gmail.com + +* 2015-08-22 - Version 1.0.6 +- Issue #57: Fixed transparent images diff --git a/escpos/escpos.py b/escpos/escpos.py index b2e91f7..2263458 100644 --- a/escpos/escpos.py +++ b/escpos/escpos.py @@ -107,7 +107,15 @@ class Escpos: def image(self,path_img): """ Open image file """ im_open = Image.open(path_img) - im = im_open.convert("RGB") + + # Remove the alpha channel on transparent images + if im_open.mode == 'RGBA': + im_open.load() + im = Image.new("RGB", im_open.size, (255, 255, 255)) + im.paste(im_open, mask=im_open.split()[3]) + else: + im = im_open.convert("RGB") + # Convert the RGB image in printable image self._convert_image(im) @@ -119,6 +127,7 @@ class Escpos: qr_code.make(fit=True) qr_img = qr_code.make_image() im = qr_img._img.convert("RGB") + # Convert the RGB image in printable image self._convert_image(im) From 37d7f3424176a00811edfa74504b0229058c4330 Mon Sep 17 00:00:00 2001 From: Manuel F Martinez Date: Sat, 22 Aug 2015 13:10:13 -0700 Subject: [PATCH 8/9] Updated project version --- CHANGELOG | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 05cc9da..f93f909 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -33,5 +33,5 @@ CHANGELOG . Extended params for serial printers . Sent by cafeteria.ldosalzira@gmail.com -* 2015-08-22 - Version 1.0.6 +* 2015-08-22 - Version 1.0.7 - Issue #57: Fixed transparent images diff --git a/setup.py b/setup.py index 7ceeb26..d29ad51 100755 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from distutils.core import setup setup( name='escpos', - version='1.0-4', + version='1.0.7', url='https://github.com/manpaz/python-escpos', download_url='https://github.com/manpaz/python-escpos.git', description='Python library to manipulate ESC/POS Printers', From 5eaa6f26d0a17002fd4b0ebe00a8fa6eadd23954 Mon Sep 17 00:00:00 2001 From: Manuel F Martinez Date: Sat, 22 Aug 2015 13:52:06 -0700 Subject: [PATCH 9/9] Added donation message --- README | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README b/README index 80c4867..aa08b13 100644 --- a/README +++ b/README @@ -85,5 +85,17 @@ The following example shows how to initialize the Epson TM-TI88IV Please visit project documentation at: https://github.com/manpaz/python-escpos/wiki +------------------------------------------------------------------ +6. Donations + +There are some different prints I'd like to acquire, but unfortunately +not all, even used, are cheaper and easy to get. + +If you want to help funding money to get more printers or just want to +donate because you like the project, please be in touch and I'll be +sending my PayPal info so you can donate. + +Thank you! + Manuel F Martinez