Exemple #1
0
def view_json_get_pi(request):
    uid = request.matchdict['uid']
    piinfo = get_pi_info(uid)


    try:
        cmd_data = json.loads(piinfo['requested_commands'])
        for i, cmdinfo in enumerate(cmd_data):
            try:
                if cmdinfo['result']:
                    piinfo['requested_commands'] = ''
                    break
            except KeyError:
                #There was no result field in the cmd_info structure, lets add it and act like it was always there
                cmdinfo['result']=''        
                piinfo['requested_commands'] = ''
    except (ValueError, TypeError):
        pass            
        

    return piinfo
Exemple #2
0
def view_json_get_pi(request):
    uid = request.matchdict['uid']
    piinfo = get_pi_info(uid)


    try:
        cmd_data = json.loads(piinfo['requested_commands'])
        for i, cmdinfo in enumerate(cmd_data):
            try:
                if cmdinfo['result']:
                    piinfo['requested_commands'] = ''
                    break
            except KeyError:
                #There was no result field in the cmd_info structure, lets add it and act like it was always there
                cmdinfo['result']=''        
                piinfo['requested_commands'] = ''
    except (ValueError, TypeError):
        pass            
        

    return piinfo
Exemple #3
0
def view_json_get_pi(request):
    uid = request.matchdict['uid']
    return get_pi_info(uid)
Exemple #4
0
def view_json_get_pi(request):
    uid = request.matchdict['uid']
    return get_pi_info(uid)