view MoinMoin/i18n/wiki2po.py @ 491:be33ecd58d4e

add run() methods to scripts, include version info into MoinMoin/__init__.py for epydoc imported from: moin--main--1.5--patch-495
author Thomas Waldmann <tw@waldmann-edv.de>
date Wed, 22 Mar 2006 09:55:32 +0000
parents 76c22aae6a64
children 16519af337fe
line wrap: on
line source
#!/usr/bin/python
"""
    get latest translation page content from the wiki and write it to *.po
"""
def run():
    import sys, xmlrpclib
    sys.path.insert(0, '../..')

    excluded = ["en",] # languages managed in tla repository, not in wiki

    langfname = sys.argv[1]
    lang = langfname.replace('_', '-') # module names use _ instead of -

    if not lang in excluded:
        wiki = xmlrpclib.ServerProxy("http://moinmaster.wikiwikiweb.de/?action=xmlrpc2")

        pagename = "MoinI18n/%s" % lang
        pagedata = wiki.getPage(pagename).encode('utf-8').replace("\n","\r\n")

        f = open("%s.po" % langfname, "w")
        f.write(pagedata)
        f.close()

if __name__ == "__main__":
    run()