-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugin.py
55 lines (47 loc) · 1.34 KB
/
plugin.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
49
50
51
52
53
54
55
import sublime
import sublime_plugin
# import functools
import pathlib
import re
import typing
from .plugins import (
_common as common
)
from .plugins.files import (
MarlantCreateTranslationFileCommand,
MarlantOpenTranslationFileCommand
)
from .plugins.titles import (
MarlantRenumberTitlesCommand,
MarlantInsertNewTitleCommand,
MarlantSplitTitleCommand,
MarlantJoinTitlesCommand
)
from .plugins.timing import (
MarlantShiftTimingsCommand
)
from .plugins.validation import (
MarlantValidateAllTitlesCommand,
MarlantExcludeTitleFromValidationsCommand,
MarlantClearExcludedTitlesList
)
from .plugins.dictionary import (
MarlantAddToDictionary,
MarlantFindInDictionary
)
def plugin_loaded() -> None:
# print("MarLant plugin has loaded")
# when Sublime Text just started, plugins path is unknown,
# and so settings need to be loaded after the plugin is loaded
common.marlantSettings = sublime.load_settings(
"marlant.sublime-settings"
)
pass
def plugin_unloaded() -> None:
# print("MarLant plugin has unloaded")
pass
# class FileEventListener(sublime_plugin.ViewEventListener):
# def on_post_save_async(self):
# # TODO: show translation progress (if in translation mode)
# if self.view.match_selector(0, "text.srt"):
# print("File was saved")