示例#1
0
文件: __init__.py 项目: allgi/mmc
def getAllSoftwaresAndVersions(ctx, softname = "", version = None):
    ret = []
    if version == None:
        ret = unique([x.name for x in Glpi().getAllSoftwares(ctx, softname)])
    else:
        if Glpi().glpi_chosen_version().find('0.8') == 0: # glpi in 0.8
            ret = unique([x.name for x in Glpi().getAllVersion4Software(ctx, softname, version)])
        else:
            if Glpi().glpi_version_new():
                ret = unique([x.name for x in Glpi().getAllVersion4Software(ctx, softname, version)])
            else:
                ret = unique([x.version for x in Glpi().getAllVersion4Software(ctx, softname, version)])
    ret.sort()
    return ret
示例#2
0
    def merge(self, lists):
        retour = []
        if len(lists) > 0:
            pos = map(lambda a:a[0], filter(lambda a:a[1], lists))
            neg = map(lambda a:a[0], filter(lambda a:not a[1], lists))
            retour = pos.pop()

            for list in pos:
                for x in list:
                    retour.append(x)
            retour = unique(retour)

            for list in neg: # don't know what to do with neg values...
                pass

        return [retour, True]
示例#3
0
def getAllContacts(ctx, value=""):
    return unique([x.contact for x in Glpi().getAllContacts(ctx, value)])
示例#4
0
def getAllComments(ctx, value=""):
    if Glpi().glpi_version[:3] == "0.8":
        return unique([x.comment for x in Glpi().getAllComments(ctx, value)])
    else:  # glpi 7
        return unique([x.comments for x in Glpi().getAllComments(ctx, value)])
示例#5
0
文件: __init__.py 项目: tekmans/mmc
def getAllComments(ctx, value = ''):
    if Glpi().glpi_chosen_version().find('0.8') == 0:
        return unique(map(lambda x:x.comment, Glpi().getAllComments(ctx, value)))
    else:
        return unique(map(lambda x:x.comments, Glpi().getAllComments(ctx, value)))
示例#6
0
文件: __init__.py 项目: tekmans/mmc
def getAllHostnames(ctx, value = ''):
    return unique(map(lambda x:x.name, Glpi().getAllHostnames(ctx, value)))
示例#7
0
def getAllSoftwareVendors(ctx, value=""):
    res = Glpi().getAllSoftwareVendors(ctx, value)
    return unique([x.name for x in res])
示例#8
0
文件: __init__.py 项目: allgi/mmc
def getAllSoftwares(ctx, value = ''):
    ret = unique([x.name for x in Glpi().getAllSoftwares(ctx, value)])
    ret.sort()
    return ret
示例#9
0
def getAllLocations(ctx, value=''):
    return unique([x.completename for x in Glpi().getAllLocations(ctx, value)])
示例#10
0
def getAllGroups(ctx, value=""):
    return unique([x.name for x in Glpi().getAllGroups(ctx, value)])
示例#11
0
def getAllContactNums(ctx, value=''):
    return unique(
        [x.contact_num for x in Glpi().getAllContactNums(ctx, value)])
示例#12
0
def getAllComments(ctx, value=''):
    if Glpi().glpi_chosen_version().find('0.8') == 0:
        return unique([x.comment for x in Glpi().getAllComments(ctx, value)])
    else:
        return unique([x.comments for x in Glpi().getAllComments(ctx, value)])
示例#13
0
def getAllSoftwares(ctx, value=''):
    ret = unique([x.name for x in Glpi().getAllSoftwares(ctx, value)])
    ret.sort()
    return ret
示例#14
0
文件: __init__.py 项目: tekmans/mmc
def getAllNetworks(ctx, value = ''):
    return unique(map(lambda x:x.name, Glpi().getAllNetworks(ctx, value)))
示例#15
0
文件: __init__.py 项目: tekmans/mmc
def getAllLocations(ctx, value = ''):
    return unique(map(lambda x:x.completename, Glpi().getAllLocations(ctx, value)))
示例#16
0
def getAllInventoryNumbers(ctx, value=""):
    return unique([x.name for x in Glpi().getAllInventoryNumbers(ctx, value)])
示例#17
0
def getAllGroups(ctx, value=''):
    return unique([x.name for x in Glpi().getAllGroups(ctx, value)])
示例#18
0
def getAllManufacturers(ctx, value=""):
    return unique([x.name for x in Glpi().getAllManufacturers(ctx, value)])
示例#19
0
def getAllNetworks(ctx, value=''):
    return unique([x.name for x in Glpi().getAllNetworks(ctx, value)])
示例#20
0
def getAllNetworks(ctx, value=""):
    return unique([x.name for x in Glpi().getAllNetworks(ctx, value)])
示例#21
0
文件: __init__.py 项目: allgi/mmc
def getAllContactNums(ctx, value = ''):
    return unique([x.contact_num for x in Glpi().getAllContactNums(ctx, value)])
示例#22
0
def getAllSoftwareVersions(ctx, value="", software=None):
    res = Glpi().getAllSoftwareVersions(ctx, filt=value, software=software)
    return unique([x.name for x in res])
示例#23
0
文件: __init__.py 项目: allgi/mmc
def getAllLocations(ctx, value = ''):
    return unique([x.completename for x in Glpi().getAllLocations(ctx, value)])
示例#24
0
def getAllHostnames(ctx, value=''):
    return unique([x.name for x in Glpi().getAllHostnames(ctx, value)])
示例#25
0
文件: __init__.py 项目: tekmans/mmc
def getAllContactNums(ctx, value = ''):
    return unique(map(lambda x:x.contact_num, Glpi().getAllContactNums(ctx, value)))
示例#26
0
文件: __init__.py 项目: allgi/mmc
def getAllComments(ctx, value = ''):
    if Glpi().glpi_chosen_version().find('0.8') == 0:
        return unique([x.comment for x in Glpi().getAllComments(ctx, value)])
    else:
        return unique([x.comments for x in Glpi().getAllComments(ctx, value)])
示例#27
0
def getAllHostnames(ctx, value=""):
    return unique([x.name for x in Glpi().getAllHostnames(ctx, value)])
示例#28
0
文件: __init__.py 项目: allgi/mmc
def getAllOs(ctx, value = ''):
    return unique([x.name for x in Glpi().getAllOs(ctx, value)])
示例#29
0
文件: __init__.py 项目: tekmans/mmc
def getAllSoftwares(ctx, value = ''):
    ret = unique(map(lambda x:x.name, Glpi().getAllSoftwares(ctx, value)))
    ret.sort()
    return ret