def package_list(args): if len(args) > 0: for name in args: show_package_contents(name) else: if logger.is_verbose(): table = [] for pacname in all_package_names(): package = read_package_info(pacname) table.append((pacname, package["title"], package["num_files"])) tty.print_table(["Name", "Title", "Files"], [ tty.bold, "", "" ], table) else: for pacname in all_package_names(): sys.stdout.write("%s\n" % pacname)
def package_list(args): if len(args) > 0: for name in args: show_package_contents(name) else: if logger.is_verbose(): table = [] for pacname in all_package_names(): package = read_package_info(pacname) table.append((pacname, package["title"], package["num_files"])) tty.print_table(["Name", "Title", "Files"], [tty.bold, "", ""], table) else: for pacname in all_package_names(): sys.stdout.write("%s\n" % pacname)
continue manuals[name] = basedir + "/" + name return manuals def print_man_page_table(): table = [] for name, path in sorted(all_man_pages().items()): try: table.append((name, _get_title_from_man_page(path))) except MKGeneralException, e: sys.stderr.write("ERROR: %s" % e) tty.print_table(['Check type', 'Title'], [tty.bold, tty.normal], table) def _get_title_from_man_page(path): for line in file(path): if line.startswith("title:"): return line.split(":", 1)[1].strip() raise MKGeneralException(_("Invalid man page: Failed to get the title")) def man_page_catalog_titles(): return catalog_titles def load_man_page_catalog(): catalog = {}