forked from GDXN/MangaCMS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirstRun.py
35 lines (24 loc) · 873 Bytes
/
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
'''
Do the initial database setup, so a functional system can be bootstrapped from an empty database.
'''
import MangaCMSOld.ScrapePlugins.M.BuMonitor.MonitorRun
import MangaCMSOld.ScrapePlugins.M.BuMonitor.ChangeMonitor
'''
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 = [
MangaCMSOld.ScrapePlugins.M.BuMonitor.MonitorRun.BuWatchMonitor,
MangaCMSOld.ScrapePlugins.M.BuMonitor.ChangeMonitor.BuDateUpdater,
]
def checkInitTables():
for plg in toInit:
print(plg)
tmp = plg()
tmp.checkInitPrimaryDb()
if hasattr(tmp, "checkInitSeriesDb"):
tmp.checkInitSeriesDb()
if __name__ == "__main__":
import MangaCMSOld.lib.logSetup
MangaCMSOld.lib.logSetup.initLogging()
checkInitTables()