-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
49 lines (40 loc) · 1.2 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import argparse
import sys
from ptpython.repl import embed
# from esssart.sources import pull_sources_list, seed_db
# from esssart.avatars import avatars
# from esssart.riff_pics import request_riffs, request_liked_riffs
from esssart.db import db
def main(argsv):
parser = argparse.ArgumentParser(description="run command.")
parser.add_argument("cmd", type=str, help="the command")
parser.add_argument(
"--limit",
type=int,
default=10,
required=False,
help="limit the number of whatever",
)
parser.add_argument(
"--start",
type=int,
default=0,
required=False,
help="starting point of the list",
)
args = parser.parse_args(argsv)
if args.cmd == "create":
pull_sources_list()
seed_db()
if args.cmd == "avatars":
avatars(limit=args.limit, start=args.start)
if args.cmd == "riffdata":
request_riffs(limit=args.limit, start=args.start)
if args.cmd == "likedriffdata":
request_liked_riffs(limit=args.limit, start=args.start)
if args.cmd == "seed":
seed_db()
if args.cmd == "cli":
pass
if __name__ == "__main__":
main(sys.argv[1:])