@@ 108-121 (lines=14) @@ | ||
105 | ||
106 | print(table) |
|
107 | elif args.action == "get": |
|
108 | index = 0 |
|
109 | for i in data['data']: |
|
110 | if len(i[1]): |
|
111 | filename = i[0] |
|
112 | print("File: {}".format(filename)) |
|
113 | table = PrettyTable(["Property", "Value"]) |
|
114 | table.align["Property"] = "l" # left align |
|
115 | table.align["Value"] = "l" # left align |
|
116 | ||
117 | for prop in i[1]: |
|
118 | value = i[1][prop] |
|
119 | table.add_row([prop, value]) |
|
120 | ||
121 | print(table) |
|
122 | if (len(data)-1) is not index: |
|
123 | print("") |
|
124 | ||
@@ 94-104 (lines=11) @@ | ||
91 | return |
|
92 | ||
93 | args = kwargs["args"] |
|
94 | ||
95 | if args.action == "alias": |
|
96 | if len(data['aliases']) == 0: |
|
97 | print("There are no aliases in config file: {}".format(data["configfile"])) |
|
98 | else: |
|
99 | table = PrettyTable(["Alias", "Command"]) |
|
100 | table.align["Alias"] = "l" # left align |
|
101 | table.align["Command"] = "l" # left align |
|
102 | ||
103 | for i in data['aliases']: |
|
104 | table.add_row([i, data['aliases'][i]]) |
|
105 | ||
106 | print(table) |
|
107 | elif args.action == "get": |