-
-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathget_scripts.py
More file actions
31 lines (25 loc) · 694 Bytes
/
get_scripts.py
File metadata and controls
31 lines (25 loc) · 694 Bytes
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
import sources
import json
import time
import multiprocessing
import os
DIR = os.path.join("scripts", "temp")
if not os.path.exists(DIR):
os.makedirs(DIR)
f = open('sources.json', 'r')
data = json.load(f)
processes = []
starttime = time.time()
for source in data:
included = data[source]
if included == "true":
# print("Fetching scripts from %s" % (source))
# sources.get_scripts(source=source)
# print()
p = multiprocessing.Process(target=sources.get_scripts, args=(source,))
processes.append(p)
p.start()
for process in processes:
process.join()
print()
print('Time taken = {} seconds'.format(time.time() - starttime))