forked from SublimeText/LaTeXTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path00_reload_submodules.py
45 lines (32 loc) · 1.03 KB
/
00_reload_submodules.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
#
# This module will reload any existing submodules, such as latextools_utils,
# that may be cached in memory. Note that it must be run before any module
# that uses any imports from any of those modules, hence the name.
#
import sublime
import sys
if sys.version_info >= (3,):
from imp import reload
MOD_PREFIX = ''
if sublime.version() > '3000':
MOD_PREFIX = 'LaTeXTools.' + MOD_PREFIX
# these modules must be specified in the order they depend on one another
LOAD_ORDER = [
'latextools_utils',
# no internal dependencies
'latextools_utils.settings',
'latextools_utils.utils',
'latextools_utils.tex_directives',
# depend on previous only
'latextools_utils.is_tex_file',
'latextools_utils.sublime_utils',
'latextools_utils.cache',
# depend on any previous
'latextools_utils.analysis',
'latextools_plugin_internal',
'latex_chars'
]
for suffix in LOAD_ORDER:
mod = MOD_PREFIX + suffix
if mod in sys.modules and sys.modules[mod] is not None:
reload(sys.modules[mod])