-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
36 lines (26 loc) · 913 Bytes
/
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
34
35
36
""" Run file
Execute this file to run the program
"""
try:
from config import main_path, link_path, wait_time
except:
print("Error: could not load configuration variables")
exit()
from main import Main
import os
import time
if __name__ == "__main__":
main = Main(main_path, link_path)
# Getting the last modification date of the link file
last_modification = os.path.getmtime(link_path)
main.download_audio(main.get_name_list())
while True:
print("log: iterating")
# Getting the last modification date of the link file, again
newest_modification = os.path.getmtime(link_path)
# Checking if the date has changed
if newest_modification != last_modification:
main.download_audio(main.get_name_list())
last_modification = newest_modification
# Waiting until next iteration
time.sleep(wait_time)