Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python2
- import os.path
- import subprocess
- PO_DIR = "po-files"
- def checkout():
- subprocess.call([ "svn",
- "checkout",
- "http://etoys.squeak.org/svn/trunk/po/zh_CN/",
- PO_DIR ])
- def update():
- subprocess.call([ "svn", "update", PO_DIR ])
- def compile_po():
- for fname in os.listdir(PO_DIR):
- if not fname.endswith(".po"):
- continue
- po = os.path.join(PO_DIR, fname)
- mo = fname.replace(".po", ".mo")
- subprocess.call([ "msgfmt", "-o", mo, po ])
- if __name__ == '__main__':
- if os.path.exists(PO_DIR):
- update()
- else:
- checkout()
- compile_po()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement