forked from GDXN/MangaCMS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirstRun.py
41 lines (30 loc) · 1.06 KB
/
firstRun.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
'''
Do the initial database setup, so a functional system can be bootstrapped from an empty database.
'''
import ScrapePlugins.M.BuMonitor.MonitorRun
import ScrapePlugins.M.BuMonitor.ChangeMonitor
import ScrapePlugins.H.DjMoeLoader.DbLoader
import ScrapePlugins.M.BtSeriesFetcher.SeriesEnqueuer
import ScrapePlugins.M.BtLoader.DbLoader
'''
We need one instance of each type of plugin (series, manga, hentai), plus some extra for no particular reason (safety!)
Each plugin is instantiated, and then the plugin database setup method is called.
'''
toInit = [
ScrapePlugins.M.BuMonitor.MonitorRun.BuWatchMonitor,
ScrapePlugins.M.BuMonitor.ChangeMonitor.BuDateUpdater,
ScrapePlugins.H.DjMoeLoader.DbLoader.DbLoader,
ScrapePlugins.M.BtSeriesFetcher.SeriesEnqueuer.SeriesEnqueuer,
ScrapePlugins.M.BtLoader.DbLoader.DbLoader,
]
def checkInitTables():
for plg in toInit:
print(plg)
tmp = plg()
tmp.checkInitPrimaryDb()
if hasattr(tmp, "checkInitSeriesDb"):
tmp.checkInitSeriesDb()
if __name__ == "__main__":
import logSetup
logSetup.initLogging()
checkInitTables()