File: trim_win32_installer.py

package info (click to toggle)
solfege 3.16.4-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 34,472 kB
  • ctags: 5,287
  • sloc: python: 22,642; xml: 14,196; ansic: 4,682; makefile: 621; sh: 287
file content (28 lines) | stat: -rw-r--r-- 733 bytes parent folder | download
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

import glob
import os
import glob
import shutil
import solfege.languages

sol_po = glob.glob("po/*.po")
sol_po = [os.path.split(x)[1] for x in sol_po]
sol_po = [os.path.splitext(x)[0] for x in sol_po]

gtk_po = glob.glob(r"win32\share\locale\*")

for lang in gtk_po:
    if os.path.split(lang)[-1] not in sol_po:
        shutil.rmtree(lang)

#for d in glob.glob("win32/python/Lib/*/test"):
#    shutil.rmtree(d)

shutil.rmtree("win32/bin/Lib/test/")
shutil.rmtree("win32/bin/Lib/lib-tk")
shutil.rmtree("win32/bin/Lib/idlelib")
shutil.rmtree("win32/bin/Lib/distutils")
for fn in glob.glob("win32/share/locale/*"):
    if not os.path.split(fn)[1] in solfege.languages.languages:
        shutil.rmtree(fn)