Пример #1
0
def command_list(text=False):
    cols = [G + Bold + "Name" + end, G + Bold + "Description" + end]
    Columns = []
    for p in modules:
        info = db.grab(p)
        Columns.append([p, info.short_description])
    utils.create_table(cols, Columns)
Пример #2
0
def command_info(p=False):
    if not p:
        error("You must enter a module to get it's information !")
        return
    p = p.lower()
    if p in modules:
        info = db.grab(p)
        print("      Module : " + utils.humanize(p))
        print(" Provided by : " + info.author)
        if info.full_description:
            print(" Description : " + info.full_description)
        else:
            print(" Description : " + info.short_description)
    else:
        error(p + " module not found!")
Пример #3
0
def command_search(text=False):
    if not text:
        error("You must enter a text to search for !")
    else:
        cols = [G + Bold + "Name" + end, G + Bold + "Description" + end]
        Columns = []
        text = text.lower()
        for p in modules:
            info = db.grab(p)
            full_text = " ".join([
                info.author, info.short_description,
                info.full_description if info.full_description else ""
            ]).lower()
            if text in full_text:
                Columns.append([p, info.short_description])
        if not Columns:
            error("Didn't find a module have the entered text!")
        else:
            utils.create_table(cols, Columns)