change list output to be more compact and sorted
This commit is contained in:
@@ -215,12 +215,16 @@ def main():
|
|||||||
|
|
||||||
if args.command == 'list':
|
if args.command == 'list':
|
||||||
file_list = read_dir(absolute_path("data"), ["INFO.json", "example.json"], True)
|
file_list = read_dir(absolute_path("data"), ["INFO.json", "example.json"], True)
|
||||||
|
file_list.sort()
|
||||||
for filename in file_list:
|
for filename in file_list:
|
||||||
file, _ = os.path.splitext(os.path.basename(filename))
|
file, _ = os.path.splitext(os.path.basename(filename))
|
||||||
print(file)
|
|
||||||
data = read_file(filename)
|
data = read_file(filename)
|
||||||
data_dict = search_keys(data, ['Name', 'ISO', 'EN-AW', 'WERKSTOFFNUMMER', 'SAE'])
|
data_dict = search_keys(data, ['Name', 'ISO', 'EN-AW', 'WERKSTOFFNUMMER', 'SAE'])
|
||||||
print_dict(data_dict, False, 2)
|
#print(file)
|
||||||
|
#print_dict(data_dict, False, 2)
|
||||||
|
print(file, end='')
|
||||||
|
aka = [i[0] for i in list(data_dict.values()) if i and file not in i]
|
||||||
|
print(" (" + ", ".join(aka) + ")")
|
||||||
|
|
||||||
elif args.command == 'get':
|
elif args.command == 'get':
|
||||||
if args.const_collection:
|
if args.const_collection:
|
||||||
|
|||||||
Reference in New Issue
Block a user