dibbler/dibbler/main.py

47 lines
981 B
Python
Raw Normal View History

import argparse
from dibbler.conf import config
parser = argparse.ArgumentParser()
parser.add_argument(
"-c",
"--config",
help="Path to the config file",
type=str,
required=False,
)
subparsers = parser.add_subparsers(
2023-08-29 23:50:34 +02:00
title="subcommands",
dest="subcommand",
required=True,
)
2023-08-29 23:50:34 +02:00
subparsers.add_parser("loop", help="Run the dibbler loop")
subparsers.add_parser("create-db", help="Create the database")
subparsers.add_parser("slabbedasker", help="Find out who is slabbedasker")
def main():
args = parser.parse_args()
config.read(args.config)
2023-08-29 23:50:34 +02:00
if args.subcommand == "loop":
import dibbler.subcommands.loop as loop
loop.main()
elif args.subcommand == "create-db":
import dibbler.subcommands.makedb as makedb
makedb.main()
2023-08-29 23:50:34 +02:00
elif args.subcommand == "slabbedasker":
import dibbler.subcommands.slabbedasker as slabbedasker
2023-08-29 23:50:34 +02:00
slabbedasker.main()
if __name__ == "__main__":
2023-08-29 23:50:34 +02:00
main()