dé-tabification
This commit is contained in:
parent
9644d0a87c
commit
dc22d01b6e
2 changed files with 20 additions and 20 deletions
22
client.py
22
client.py
|
@ -54,20 +54,20 @@ class Ticket(object):
|
||||||
chambre = u'EXT'
|
chambre = u'EXT'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
deb_adh = crans_utils.datetime_from_generalized_time_format(facture['debutAdhesion'][0].value)
|
deb_adh = crans_utils.datetime_from_generalized_time_format(facture['debutAdhesion'][0].value)
|
||||||
deb_adh = deb_adh.strftime('%d/%m/%Y')
|
deb_adh = deb_adh.strftime('%d/%m/%Y')
|
||||||
except:
|
except:
|
||||||
deb_adh=False
|
deb_adh=False
|
||||||
try:
|
try:
|
||||||
fin_adh = crans_utils.datetime_from_generalized_time_format(facture['finAdhesion'][0].value)
|
fin_adh = crans_utils.datetime_from_generalized_time_format(facture['finAdhesion'][0].value)
|
||||||
fin_adh = fin_adh.strftime('%d/%m/%Y')
|
fin_adh = fin_adh.strftime('%d/%m/%Y')
|
||||||
except:
|
except:
|
||||||
fin_adh=False
|
fin_adh=False
|
||||||
try:
|
try:
|
||||||
fin_co = crans_utils.datetime_from_generalized_time_format(facture['finConnexion'][0].value)
|
fin_co = crans_utils.datetime_from_generalized_time_format(facture['finConnexion'][0].value)
|
||||||
fin_co = fin_co.strftime('%d/%m/%Y')
|
fin_co = fin_co.strftime('%d/%m/%Y')
|
||||||
except:
|
except:
|
||||||
fin_co=False
|
fin_co=False
|
||||||
todo = {
|
todo = {
|
||||||
'fid' : facture['fid'][0].value,
|
'fid' : facture['fid'][0].value,
|
||||||
'article' : [ art.value for art in facture['article']],
|
'article' : [ art.value for art in facture['article']],
|
||||||
|
|
18
daemon.py
18
daemon.py
|
@ -10,16 +10,16 @@ import dump
|
||||||
import config
|
import config
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
conn = pika.BlockingConnection(config.PARAMS)
|
conn = pika.BlockingConnection(config.PARAMS)
|
||||||
ch = conn.channel()
|
ch = conn.channel()
|
||||||
ch.queue_declare(queue=config.QUEUE)
|
ch.queue_declare(queue=config.QUEUE)
|
||||||
def callback(ch, method, properties, body):
|
def callback(ch, method, properties, body):
|
||||||
print (" [x] Received %r" % (body,))
|
print (" [x] Received %r" % (body,))
|
||||||
dump.print_liste(json.loads(body))
|
dump.print_liste(json.loads(body))
|
||||||
|
|
||||||
ch.basic_consume(callback, queue=config.QUEUE, no_ack=True)
|
ch.basic_consume(callback, queue=config.QUEUE, no_ack=True)
|
||||||
ch.start_consuming()
|
ch.start_consuming()
|
||||||
conn.close()
|
conn.close()
|
||||||
# fork en arrière plan + pidfile
|
# fork en arrière plan + pidfile
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue