-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.py
52 lines (40 loc) · 958 Bytes
/
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
50
51
52
import argparse
import sys
from FileManager import FileManager
from Uploader import Uploader
from pprint import pprint
def main():
args = parseArguments()
fileManager = FileManager(args=args)
demoPathAttributes = fileManager.getAttributes()
uploader = Uploader(demoPathAttributes)
uploader.upload()
def parseArguments():
possibleArguments = ['-p', '-d', '-c']
args = sys.argv[1:]
# Demo Path
if '-p' in args:
nextArg = args[args.index('-p') + 1]
if nextArg not in possibleArguments:
demoPath = nextArg
else:
demoPath = None
else:
demoPath = None
# Database Path
if '-d' in args:
nextArg = args[args.index('-d') + 1]
if nextArg not in possibleArguments:
databasePath = nextArg
else:
databasePath = None
else:
databasePath = None
# Create database
if '-c' in args:
createDatabase = True
else:
createDatabase = False
return [demoPath, databasePath, createDatabase]
if __name__ == '__main__':
main()