-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
48 lines (33 loc) · 1.31 KB
/
main.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
42
43
44
45
46
47
48
# --- Clear module cache ---
# Clear module cache to force reloading all modules of this package.
# See https://github.com/emmetio/sublime-text-plugin/issues/35
import sys
prefix = __package__ + "." # don't clear the base package
for module_name in [
module_name
for module_name in sys.modules
if module_name.startswith(prefix) and module_name != __name__
]:
del sys.modules[module_name]
# --- Clear module cache ---
import sublime_plugin # noqa: E402
from .plugin import SCOPE_LAST, Plugin # noqa: E402
class AnyTestRunCommand(sublime_plugin.TextCommand):
def run(self, _, scope="file", edit=False, select=False):
plugin = Plugin(self.view)
if select and scope != SCOPE_LAST:
plugin.select_test_framework(scope, edit)
else:
plugin.run_test(scope, edit)
class AnyTestShowLastOutputCommand(sublime_plugin.ApplicationCommand):
def run(self, focus=True):
Plugin.show_last_output(focus=focus)
class AnyTestEditLastCommand(sublime_plugin.ApplicationCommand):
def run(self):
Plugin.edit_last()
class AnyTestShowHistoryCommand(sublime_plugin.TextCommand):
def run(self, _):
Plugin(self.view).show_history()
class AnyTestClearHistoryCommand(sublime_plugin.ApplicationCommand):
def run(self):
Plugin.clear_history()