forked from aussig/BGS-Tally
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathload.py
More file actions
67 lines (47 loc) · 1.55 KB
/
load.py
File metadata and controls
67 lines (47 loc) · 1.55 KB
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
from os import path
from companion import CAPIData
from bgstally.bgstally import BGSTally
from bgstally.debug import Debug
from bgstally.constants import UpdateUIPolicy
import semantic_version
PLUGIN_NAME = "BGS-Tally"
PLUGIN_VERSION = semantic_version.Version.coerce("3.2.0-b2")
# Initialise the main plugin class
this:BGSTally = BGSTally(PLUGIN_NAME, PLUGIN_VERSION)
def plugin_start3(plugin_dir):
"""
Load this plugin into EDMC
"""
this.plugin_start(plugin_dir)
tick_success = this.check_tick(UpdateUIPolicy.NEVER)
if tick_success == None:
# Cannot continue if we couldn't fetch a tick
raise Exception("BGS-Tally couldn't continue because the current tick could not be fetched")
return this.plugin_name
def plugin_stop():
"""
EDMC is closing
"""
this.plugin_stop()
def plugin_app(parent):
"""
Return a TK Frame for adding to the EDMC main window
"""
return this.ui.get_plugin_frame(parent)
def plugin_prefs(parent, cmdr, is_beta):
"""
Return a TK Frame for adding to the EDMC settings dialog
"""
return this.ui.get_prefs_frame(parent)
def journal_entry(cmdr, is_beta, system, station, entry, state):
"""
Parse an incoming journal entry and store the data we need
"""
if this.state.Status.get() != "Active": return
this.journal_entry(cmdr, is_beta, system, station, entry, state)
def capi_fleetcarrier(data: CAPIData):
"""
Handle Fleet carrier data
"""
if this.state.Status.get() != "Active": return
this.capi_fleetcarrier(data)