
import glob
import os
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\GTK\share\locale\*")

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

shutil.rmtree(r"win32\python\Lib\test")
shutil.rmtree(r"win32\python\Lib\curses")
shutil.rmtree(r"win32\share\applications")
shutil.rmtree(r"win32\share\man")
shutil.rmtree(r"win32\python\Doc")
shutil.rmtree(r"win32\python\tcl")
shutil.rmtree(r"win32\python\Tools")
shutil.rmtree(r"win32\test")
shutil.rmtree(r"win32\include")
shutil.rmtree(r"win32\python\include")
for fn in glob.glob("win32/share/locale/*"):
    if not os.path.split(fn)[1] in solfege.languages.languages:
        shutil.rmtree(fn)

