-
Notifications
You must be signed in to change notification settings - Fork 22
/
main.py
35 lines (26 loc) · 956 Bytes
/
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
from sys import version_info
import sublime
from .plugin import * # noqa: F403
def entry():
import_custom_modules()
# CleanupHandler.remove_junk()
ready = create_package_config_files()
if ready:
ConfigHandler.load_sublime_preferences()
ConfigHandler.setup_config()
ConfigHandler.setup_shared_config_files()
ConfigHandler.set_debug_mode()
log.info('%s version: %s (Python %s)', PACKAGE_NAME, __version__, '.'.join(map(str, version_info[:3])))
log.debug('Plugin initialization ' + ('succeeded.' if ready else 'failed.'))
def plugin_loaded():
ConfigHandler.setup_config()
def call_entry():
sublime.set_timeout_async(lambda: entry(), 100)
try:
from package_control import events
if events.install(PACKAGE_NAME) or events.post_upgrade(PACKAGE_NAME):
call_entry()
else:
call_entry()
except ImportError:
call_entry()