1
0
Fork 0
mirror of https://github.com/yavook/kiwi-scp.git synced 2024-11-22 12:53:00 +00:00
kiwi-scp/src/kiwi-config.py

42 lines
754 B
Python
Raw Normal View History

2020-08-04 14:52:30 +00:00
#!/usr/bin/env python3
import logging
2020-08-06 11:43:45 +00:00
import kiwi
from kiwi.subcommands import *
2020-08-04 14:52:30 +00:00
2020-08-06 12:34:25 +00:00
def main():
logging.basicConfig(
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
level=logging.NOTSET
)
commands = [
InitCommand,
ShowCommand,
LogsCommand
]
for cmd in commands:
cmd.setup()
args = kiwi.Parser.get_args()
if args.verbose >= 2:
log_level = logging.DEBUG
elif args.verbose >= 1:
log_level = logging.INFO
else:
log_level = logging.WARNING
logging.getLogger().setLevel(log_level)
for cmd in commands:
if cmd.command == args.command:
cmd.run()
return
2020-08-04 14:52:30 +00:00
if __name__ == "__main__":
main()