-
Notifications
You must be signed in to change notification settings - Fork 33
/
Sublimall.py
59 lines (50 loc) · 1.7 KB
/
Sublimall.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
56
57
58
59
# -*- coding: utf-8 -*-
import os
import sys
import imp
import sublime
from imp import reload
st_version = 2
if int(sublime.version()) > 3000:
st_version = 3
if st_version == 2:
msg = "Sublimall is only available for SublimeText 3.\n Sorry about that."
sublime.error_message(msg)
if sublime.platform() == 'linux':
so_name = '_ssl.cpython-33m.so'
arch_lib_path = os.path.join(
os.path.dirname(__file__),
'lib',
'st%d_linux_%s' % (st_version, sublime.arch()))
print('[Sublimall] enabling custom linux ssl module')
for ssl_ver in ['1.0.0', '10', '0.9.8']:
lib_path = os.path.join(arch_lib_path, 'libssl-' + ssl_ver)
sys.path.append(lib_path)
try:
import _ssl
print(
'[Sublimall] successfully loaded _ssl '
'module for libssl.so.%s' % ssl_ver)
import http.client
imp.reload(http.client)
break
except (ImportError) as e:
print('[Sublimall] _ssl module import error - ' + str(e))
if '_ssl' in sys.modules:
try:
import ssl
except (ImportError) as e:
print('[Sublimall] ssl module import error - ' + str(e))
reloader_name = 'Sublimall.sublimall.reloader'
if reloader_name in sys.modules:
reload(sys.modules[reloader_name])
def plugin_loaded():
from .sublimall.utils import get_7za_bin
if get_7za_bin() is None:
msg = (
"Sublimall needs 7zip to compress and encrypt "
"your configuration.\n"
"Please install it and specify its path in the settings file.")
sublime.error_message(msg)
from .sublimall import reloader
from .sublimall.commands import *