-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
33 lines (26 loc) · 1.21 KB
/
run.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
import asyncio
import queue
import argparse
from scripts.model import main
def run_model(days, model, lease, sale):
if model:
if sale and lease:
main(days, None)
else:
if lease:
main(days, 'lease')
if sale:
main(days, 'sale')
else:
print("Create model was not specified")
parser = argparse.ArgumentParser(description = 'Enter the amount of days to retrieve information from')
parser.add_argument("days", help='A natural number for the number of days to retrieve information from', metavar='days')
parser.add_argument("-l", "--lease", action="store_true", help='specify if you want to generate a new model specifically for lease data \'-m must be specified\'')
parser.add_argument("-s", "--sale", action="store_true", help='specify if you want to generate a new model specifically for sale data \'-m must be specified\'')
parser.add_argument("-m", "--model", action = "store_true", help='specify if you want to generate a model')
args = parser.parse_args()
try:
days = int(args.days)
except:
print("This cannot be converted into an int, please enter a different value")
run_model(days, args.model, args.lease, args.sale)