示例#1
0
def getProfilesJSON():
    '''
    returns a JSON-string with the wlan-profiles saved on this computer
    '''
    out = executeAndGetLines("netsh wlan show profiles")
    OutStructure = __buildProfileStructure(out)
    return OutStructure
示例#2
0
def IPv4_globalParameters():
    '''
    returns the global parameters encoded in JSON of the IPv4
    '''
    output = executeAndGetLines("netsh interface ipv4 show global")[
        1:]  #skip first
    return json.dumps(__abstractDeconstruct(output))
示例#3
0
def Teredo_showState():
    '''
    returns a JSON-string with the state of the Teredo Client
    '''
    output = executeAndGetLines("netsh interface teredo show state")
    outStructure = {}
    for line in output:
        key, value = __getValuePairFromLine(line)
        if key != None and value != None:
            outStructure[key] = value
    return json.dumps(outStructure)
示例#4
0
def getAvilableNetworksJSON():
    '''
    returns an JSON-encoded list of Strings containing information of available Networks
    '''
    output = executeAndGetLines("netsh wlan show networks")
    Wifis = []
    output = output[1:]         #Skip interface name
    while output[0].find(":") < 0: output = output[1:]
    while len(output) >= 4:
        key, name = __getValuePairFromLine(output[0])
        if key != None:
            Structure = {key:{}}
            Structure[key]["name"] = name
            for x in range(1,4):
                attr, value = __getValuePairFromLine(output[x])
                Structure[key][attr] = value
            Wifis.append(json.dumps(Structure))
        output = output[4:]
    return Wifis
示例#5
0
def getInterfacesJSON():
    '''
    returns a JSON-string with the interfaces-profiles and their current status
    '''
    output = executeAndGetLines("netsh interface show interface")
    return __buildProfileStructure(output)