2023-08-29 22:50:53 +02:00
|
|
|
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",
|
2023-08-29 22:50:53 +02:00
|
|
|
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")
|
|
|
|
|
2023-08-29 22:50:53 +02:00
|
|
|
|
|
|
|
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 22:50:53 +02:00
|
|
|
|
2023-08-29 23:50:34 +02:00
|
|
|
elif args.subcommand == "slabbedasker":
|
|
|
|
import dibbler.subcommands.slabbedasker as slabbedasker
|
2023-08-29 22:50:53 +02:00
|
|
|
|
2023-08-29 23:50:34 +02:00
|
|
|
slabbedasker.main()
|
2023-08-29 22:50:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2023-08-29 23:50:34 +02:00
|
|
|
main()
|