-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathload.py
More file actions
30 lines (23 loc) · 784 Bytes
/
load.py
File metadata and controls
30 lines (23 loc) · 784 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
import sys
import edmc_data
from systemscan import SystemScan
this = sys.modules[__name__]
this.s = None
this.journal_funcs = {}
def plugin_start3(plugin_dir):
this.s = SystemScan()
for fname in dir(this.s):
func = getattr(this.s, fname, None)
if fname.startswith('journal_') and callable(func):
this.journal_funcs[fname[8:]] = func
return this.s.load()
def plugin_stop():
return this.s.unload()
def plugin_app(parent):
return this.s.create_ui(parent)
def dashboard_entry(cmdr, is_beta, entry):
this.s.show_ui(entry['Flags'] & edmc_data.FlagsInMainShip)
def journal_entry(cmdr, is_beta, system, station, entry, state):
func = this.journal_funcs.get(entry["event"])
if func and func(entry):
this.s.update_ui()