diff 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 diff
--- a/MoinMoin/i18n/wiki2po.py	Wed Mar 22 09:03:08 2006 +0000
+++ b/MoinMoin/i18n/wiki2po.py	Wed Mar 22 09:55:32 2006 +0000
@@ -2,21 +2,25 @@
 """
     get latest translation page content from the wiki and write it to *.po
 """
-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 -
+def run():
+    import sys, xmlrpclib
+    sys.path.insert(0, '../..')
 
-if not lang in excluded:
-    wiki = xmlrpclib.ServerProxy("http://moinmaster.wikiwikiweb.de/?action=xmlrpc2")
+    excluded = ["en",] # languages managed in tla repository, not in wiki
 
-    pagename = "MoinI18n/%s" % lang
-    pagedata = wiki.getPage(pagename).encode('utf-8').replace("\n","\r\n")
+    langfname = sys.argv[1]
+    lang = langfname.replace('_', '-') # module names use _ instead of -
 
-    f = open("%s.po" % langfname, "w")
-    f.write(pagedata)
-    f.close()
+    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()
+