mirror of
https://github.com/Andre0512/pyhOn.git
synced 2025-05-20 18:05:17 -04:00
Show more command data
This commit is contained in:
parent
79a121263f
commit
43d61ab853
6 changed files with 22 additions and 12 deletions
|
@ -24,7 +24,7 @@ def get_arguments():
|
|||
return vars(parser.parse_args())
|
||||
|
||||
|
||||
# yaml.dump() would be done the same, but needs an additional import...
|
||||
# yaml.dump() would be done the same, but needs an additional dependency...
|
||||
def pretty_print(data, key="", intend=0, is_list=False):
|
||||
if type(data) is list:
|
||||
if key:
|
||||
|
@ -47,6 +47,18 @@ def pretty_print(data, key="", intend=0, is_list=False):
|
|||
print(f"{' ' * intend}{'- ' if is_list else ''}{key}{': ' if key else ''}{data}")
|
||||
|
||||
|
||||
def create_command(commands):
|
||||
result = {}
|
||||
for name, command in commands.items():
|
||||
result[name] = {}
|
||||
for parameter, data in command.parameters.items():
|
||||
if data.typology == "enum":
|
||||
result[name][parameter] = data.values
|
||||
if data.typology == "range":
|
||||
result[name][parameter] = {"min": data.min, "max": data.max, "step": data.step}
|
||||
return result
|
||||
|
||||
|
||||
async def main():
|
||||
args = get_arguments()
|
||||
if not (user := args["user"]):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue