def quickbooksGLresponse():
    """Poll for QuickBooks protocol responses for *get* requests to */rest/quickbooks/response*.
    
    :returns: html, xml, csv, text -- Return per media type argument and request arguments, if response is ready, otherwise javascript to requery this *get* request periodicially.
    """
    from arelle import CntlrQuickBooks
    ticket = request.query.ticket
    media = request.query.media
    viewRequested = request.query.view
    status = CntlrQuickBooks.qbRequestStatus.get(ticket)
    if not status:
        return htmlBody(tableRows([_("QuickBooks ticket not found, request canceled.")], header=_("Quickbooks Request")))
    if status.startswith("ConnectionErrorMessage: "):
        CntlrQuickBooks.qbRequestStatus.pop(ticket, None)
        return errorReport([status[24:]], media)
    if status != "Done" or ticket not in CntlrQuickBooks.xbrlInstances:
        return htmlBody(tableRows([_("{0}, Waiting 20 seconds...").format(status)], 
                                  header=_("Quickbooks Request")), 
                                  script='''
<script type="text/javascript">
<!-- 
var timer = setInterval("autoRefresh()", 1000 * 20);
function autoRefresh(){{clearInterval(timer);self.location.reload(true);}}
//--> 
</script>
''')
    CntlrQuickBooks.qbRequestStatus.pop(ticket)
    
    instanceUuid = CntlrQuickBooks.xbrlInstances[ticket]
    CntlrQuickBooks.xbrlInstances.pop(ticket)
    options = Options()
    setattr(options, "entrypointFile", instanceUuid)
    viewFile = FileNamedStringIO(media)
    setattr(options, "factsFile", viewFile)
    return runOptionsAndGetResult(options, media, viewFile)
dataset/ETHPy150Open Arelle/Arelle/arelle/CntlrWebMain.py/quickbooksGLresponse/original