forked from daveleroy/SublimeDebugger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.py
38 lines (29 loc) · 1.19 KB
/
start.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
import sys
module_starts_with = __package__ + '.'
modules_to_remove = list(filter(lambda m: m.startswith(module_starts_with) and m != __name__, sys.modules.keys()))
for m in modules_to_remove:
del sys.modules[m]
if modules_to_remove:
print("removed old modules: {}".format(modules_to_remove))
# import all the commands so that sublime sees them
from .modules.debugger.commands import DebuggerCommand
from .modules.debugger.view_selected_source import DebuggerReplaceContentsCommand, DebuggerShowLineCommand
from .modules.debugger.terminals.terminal_build import DebuggerBuildExecCommand
from .modules.ui.input import DebuggerInputCommand
from .modules.ui.events import ViewEventsListener
from .modules.debugger.output_panel import *
# try:
# dir_path = os.path.dirname(os.path.realpath(__file__))
# sys.path.insert(0, os.path.join(dir_path, "modules/libs"))
# from .modules.libs import ptvsd
# ptvsd.enable_attach(address=('localhost', 5678), redirect_output=True)
# except:
# core.log_exception()
def plugin_loaded():
print('plugin_loaded')
from .modules.debugger.main import startup
startup()
def plugin_unloaded():
print('plugin_unloaded')
from .modules.debugger.main import shutdown
shutdown()