-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathrelease.py
More file actions
37 lines (30 loc) · 824 Bytes
/
release.py
File metadata and controls
37 lines (30 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
#!/bin/env python3
from glob import glob
import zipfile
import os
def compile_mo():
for po in glob("translations/*.po"):
print(f"compiling {po}")
os.system(
f'calibre-debug -c "from calibre.translations.msgfmt import main; main()" {po}'
)
def mkzip():
filelist = [
"__init__.py",
"config.py",
"plugin-import-name-notrans.txt",
"ui.py",
"images/icon.png",
]
for root, dirs, files in os.walk('translations'):
for f in files:
if not f.endswith("po"):
filelist.append(os.path.join(root, f))
zf = zipfile.ZipFile("NoTrans.zip", "w")
for file in filelist:
print(f"compressing {file}")
zf.write(file)
zf.close()
if __name__ == "__main__":
compile_mo()
mkzip()