Ejemplo n.º 1
0
def search_file(term):
    """
    Returns a tuple of package and matched files list that matches the files of the installed
    packages -> list_of_tuples
    @param term: used to search file -> list_of_strings

    >>> files = pisi.api.search_file("kvm-")

    >>> print files

    >>> [("kvm", (["lib/modules/2.6.18.8-86/extra/kvm-amd.ko","lib/modules/2.6.18.8-86/extra/kvm-intel.ko"])),]
    """
    filesdb = pisi.db.filesdb.FilesDB()
    if term.startswith("/"):  # FIXME: why? why?
        term = term[1:]
    return filesdb.search_file(term)
Ejemplo n.º 2
0
def search_file(term):
    """
    Returns a tuple of package and matched files list that matches the files of the installed
    packages -> list_of_tuples
    @param term: used to search file -> list_of_strings

    >>> files = pisi.api.search_file("kvm-")

    >>> print files

    >>> [("kvm", (["lib/modules/2.6.18.8-86/extra/kvm-amd.ko","lib/modules/2.6.18.8-86/extra/kvm-intel.ko"])),]
    """
    filesdb = pisi.db.filesdb.FilesDB()
    if term.startswith("/"): # FIXME: why? why?
        term = term[1:]
    return filesdb.search_file(term)