def package_list(args): if len(args) > 0: for name in args: show_package_contents(name) else: if logger.isEnabledFor(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): # type: (List[str]) -> None if len(args) > 0: for name in args: show_package_contents(name) else: if logger.isEnabledFor(VERBOSE): table = [] for pacname in all_package_names(): package = read_package_info(pacname) if package is None: table.append([pacname, "package info is missing or broken", "0"]) else: table.append([pacname, package["title"], str(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 test_create_package(): assert packaging.all_package_names() == [] _create_simple_test_package("aaa") assert packaging.all_package_names() == ["aaa"]