Пример #1
0
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
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
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
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
def getAllNetworks(ctx, value = ''):
    return unique(map(lambda x:x.name, Glpi().getAllNetworks(ctx, value)))
Пример #15
0
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
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
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
def getAllContactNums(ctx, value = ''):
    return unique(map(lambda x:x.contact_num, Glpi().getAllContactNums(ctx, value)))
Пример #26
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)])
Пример #27
0
def getAllHostnames(ctx, value=""):
    return unique([x.name for x in Glpi().getAllHostnames(ctx, value)])
Пример #28
0
def getAllOs(ctx, value = ''):
    return unique([x.name for x in Glpi().getAllOs(ctx, value)])
Пример #29
0
def getAllSoftwares(ctx, value = ''):
    ret = unique(map(lambda x:x.name, Glpi().getAllSoftwares(ctx, value)))
    ret.sort()
    return ret