forked from teared/VEX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VEX.py
41 lines (38 loc) · 1.08 KB
/
VEX.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
if __name__ == '__main__':
# Collect package if runned as script.
import os.path as op
from os import walk
from zipfile import ZipFile, ZIP_DEFLATED
root = op.dirname(__file__)
allow_dirs = (
'.',
'commands',
'prefs',
'snippets',
'syntax',
)
allow_exts = (
'.css',
'.json',
'.py',
'.sublime-build',
'.sublime-commands',
'.sublime-completions',
'.sublime-keymap',
'.sublime-menu',
'.sublime-settings',
'.sublime-snippet',
'.sublime-syntax',
'.tmPreferences',
)
with ZipFile('VEX.sublime-package', 'w', ZIP_DEFLATED) as z:
for folder, _, files in walk(root):
folder = op.relpath(folder, root)
if folder in allow_dirs:
for f in files:
ext = op.splitext(f)[-1]
if ext in allow_exts:
z.write(op.join(folder, f))
else:
from .commands.vex_build import VexBuildCommand
from .commands.helpcard import HelpcardCommand