예제 #1
0
def iterate_invoices_start():
    request = qbxml.invoice_request_iterative()
    session_manager.queue_session({
        'reqXML': request,
        'ticket': "",
        'callback': iterate_invoices_continue,
        'updatePauseSeconds': "",
        'minimumUpdateSeconds': 60,
        'MinimumRunEveryNSeconds': 45
    })
예제 #2
0
파일: pyQBWC.py 프로젝트: diegodf/pyQBWC
def iterate_invoices_continue(ticket,responseXML):
    db.insert_invoice(responseXML)
    root = etree.fromstring(responseXML)
    # do something with the response, store it in a database, return it somewhere etc
    requestID = int(root.xpath('//InvoiceQueryRs/@requestID')[0])
    iteratorRemainingCount = int(root.xpath('//InvoiceQueryRs/@iteratorRemainingCount')[0])
    iteratorID = root.xpath('//InvoiceQueryRs/@iteratorID')[0]
    print "iteratorID",iteratorID,"iteratorRemainingCount:",iteratorRemainingCount,'requestID',requestID
    if iteratorRemainingCount:
        requestID +=1
        request = qbxml.invoice_request_iterative(requestID=requestID,iteratorID=iteratorID)
        session_manager.queue_session({'reqXML':request,'ticket':ticket,'callback':iterate_invoices_continue,'updatePauseSeconds':"",'minimumUpdateSeconds':60,'MinimumRunEveryNSeconds':45})
예제 #3
0
def iterate_invoices_continue(ticket, responseXML):
    db.insert_invoice(responseXML)
    root = etree.fromstring(responseXML)
    # do something with the response, store it in a database, return it somewhere etc
    requestID = int(root.xpath('//InvoiceQueryRs/@requestID')[0])
    iteratorRemainingCount = int(
        root.xpath('//InvoiceQueryRs/@iteratorRemainingCount')[0])
    iteratorID = root.xpath('//InvoiceQueryRs/@iteratorID')[0]
    print "iteratorID", iteratorID, "iteratorRemainingCount:", iteratorRemainingCount, 'requestID', requestID
    if iteratorRemainingCount:
        requestID += 1
        request = qbxml.invoice_request_iterative(requestID=requestID,
                                                  iteratorID=iteratorID)
        session_manager.queue_session({
            'reqXML': request,
            'ticket': ticket,
            'callback': iterate_invoices_continue,
            'updatePauseSeconds': "",
            'minimumUpdateSeconds': 60,
            'MinimumRunEveryNSeconds': 45
        })
예제 #4
0
파일: pyQBWC.py 프로젝트: diegodf/pyQBWC
def iterate_invoices_start():
    request = qbxml.invoice_request_iterative()
    session_manager.queue_session({'reqXML':request,'ticket':"",'callback':iterate_invoices_continue,'updatePauseSeconds':"",'minimumUpdateSeconds':60,'MinimumRunEveryNSeconds':45})