-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
38 lines (31 loc) · 1.02 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
import sys
from profile import Profile
from product import Product
from watch import WatchProcess
from helpers import read_data
def main():
# Reading data from profile and product files
profiles_file = read_data('profiless')
products_file = read_data('productss')
products, profiles = [], []
# Creating list of Profiles and Products
for name, profile in profiles_file.items():
if profile['Email']:
profiles.append(Profile(name, profile))
for product in products_file:
if product['Product URL']:
products.append(Product(product))
# Begin watch process
if products:
watch_process = WatchProcess(profiles, products)
watch_process.begin()
else:
print('No products found.')
print('Enter products in data/products.json')
print('Refer to README.md for instructions')
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print('\n\U0001F44B Ending watch process...')
sys.exit(0)