-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmake.py
More file actions
executable file
·41 lines (26 loc) · 824 Bytes
/
make.py
File metadata and controls
executable file
·41 lines (26 loc) · 824 Bytes
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
#!/usr/bin/env python
# Script for building KeepNote extensions
import os
from subprocess import call, Popen, PIPE
def make_ext(base, folder):
ext = folder + ".kne"
olddir = os.getcwd()
os.chdir(base)
call(["rm", "-f", ext])
call(["zip", "-r", ext, folder])
os.chdir(olddir)
def clear_pyc(base):
for root, dirs, files in os.walk(base):
for fn in files:
if fn.endswith(".pyc"):
full = os.path.join(root, fn)
print "remove", full
os.remove(full)
def make_ext_set(base):
clear_pyc(base)
for ext in os.listdir(base):
if os.path.isdir(os.path.join(base, ext)):
print "make", ext
make_ext(base, ext)
for ext_set in ["builtin", "stable", "testing"]:
make_ext_set(ext_set)