Ajout des fonctions d'impression des factures sur l'imprimante thermique

This commit is contained in:
Hamza Dely 2015-02-22 00:08:05 +01:00
parent 6b08464bfc
commit 2d4647e9bf
5 changed files with 133 additions and 11 deletions

View file

@ -12,12 +12,12 @@ import config
def run():
conn = pika.BlockingConnection(config.PARAMS)
ch = conn.channel()
ch.queue_declare(queue='CransTicket')
ch.queue_declare(queue='CransTicketDebug')
def callback(ch, method, properties, body):
print (" [x] Received %r" % (body,))
dump.print_liste(json.loads(body))
ch.basic_consume(callback, queue='CransTicket', no_ack=True)
ch.basic_consume(callback, queue='CransTicketDebug', no_ack=True)
ch.start_consuming()
conn.close()
# fork en arrière plan + pidfile