Beispiel #1
0
def office_convert_query_status(request):
    if not HAS_OFFICE_CONVERTER:
        raise Http404

    if not request.is_ajax():
        raise Http404

    content_type = 'application/json; charset=utf-8'

    ret = {'success': False}

    file_id = request.GET.get('file_id', '')
    if len(file_id) != 40:
        ret['error'] = 'invalid param'
    else:
        try:
            d = query_office_convert_status(file_id)
            if d.error:
                ret['error'] = d.error
            else:
                ret['success'] = True
                ret['status'] = d.status
        except Exception, e:
            logging.exception('failed to call query_office_convert_status');
            ret['error'] = str(e)
Beispiel #2
0
def office_convert_query_status(request):
    if not HAS_OFFICE_CONVERTER:
        raise Http404

    if not request.is_ajax():
        raise Http404

    content_type = 'application/json; charset=utf-8'

    ret = {'success': False}

    file_id = request.GET.get('file_id', '')
    if len(file_id) != 40:
        ret['error'] = 'invalid param'
    else:
        try:
            d = query_office_convert_status(file_id)
            if d.error:
                ret['error'] = d.error
            else:
                ret['success'] = True
                ret['status'] = d.status
        except Exception, e:
            logging.exception('failed to call query_office_convert_status')
            ret['error'] = str(e)
Beispiel #3
0
def office_convert_query_status(request):
    if not HAS_OFFICE_CONVERTER:
        raise Http404

    if not request.is_ajax():
        raise Http404

    content_type = "application/json; charset=utf-8"

    ret = {"success": False}

    file_id = request.GET.get("file_id", "")
    if len(file_id) != 40:
        ret["error"] = "invalid param"
    else:
        try:
            d = query_office_convert_status(file_id)
            if d.error:
                ret["error"] = d.error
            else:
                ret["success"] = True
                ret["status"] = d.status
        except Exception, e:
            logging.exception("failed to call query_office_convert_status")
            ret["error"] = str(e)