forked from bloodcurdle/xA-Scraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-all.py
68 lines (42 loc) · 1.39 KB
/
run-all.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import plugins.scrapers.fa.faScrape
import plugins.scrapers.px.pxScrape
import plugins.scrapers.ib.ibScrape
import plugins.scrapers.hf.hfScrape
import plugins.scrapers.da.daScrape
import plugins.scrapers.wy.wyScrape
import flags
import logSetup
import signal
import multiprocessing.managers
manager = multiprocessing.managers.SyncManager()
manager.start()
namespace = manager.Namespace()
namespace.run=True
def go():
# daGrabber = plugins.scrapers.da.daScrape.GetDA()
# daGrabber.go(ctrlNamespace=namespace)
# faGrabber = plugins.scrapers.fa.faScrape.GetFA()
# faGrabber.go(ctrlNamespace=namespace)
# ibGrab = plugins.scrapers.ib.ibScrape.GetIb()
# ibGrab.go(ctrlNamespace=namespace)
# hfGrabber = plugins.scrapers.hf.hfScrape.GetHF()
# hfGrabber.go(ctrlNamespace=namespace)
# daGrabber = plugins.scrapers.da.daScrape.GetDA()
# daGrabber.go(ctrlNamespace=namespace)
# wyGrab = plugins.scrapers.wy.wyScrape.GetWy()
# wyGrab.go(ctrlNamespace=namespace)
pxGrabber = plugins.scrapers.px.pxScrape.GetPX()
pxGrabber.checkLogin()
pxGrabber.go(ctrlNamespace=namespace)
def signal_handler(dummy_signal, dummy_frame):
if flags.run:
flags.run = False
namespace.run=False
print("Telling threads to stop")
else:
print("Multiple keyboard interrupts. Raising")
raise KeyboardInterrupt
if __name__ == "__main__":
signal.signal(signal.SIGINT, signal_handler)
logSetup.initLogging()
go()