changeset 3436:7b96b91b9206

i18n tools: use multicall and getAuthToken instead of http basic auth transport
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 20 Mar 2008 18:43:56 +0100
parents 1a95fc180bdd
children 30a254da9eba
files MoinMoin/i18n/tools/po2wiki.py
diffstat 1 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/i18n/tools/po2wiki.py	Sun Mar 30 00:13:49 2008 +0100
+++ b/MoinMoin/i18n/tools/po2wiki.py	Thu Mar 20 18:43:56 2008 +0100
@@ -40,18 +40,20 @@
 %s""" % (lang, lang, data)
 
 
-    from MoinMoin.support.BasicAuthTransport import BasicAuthTransport
-
     user = "ThomasWaldmann" # must be a known Wiki account
     password = os.environ.get("PASS", "")
     pagename = "MoinI18n/%s" % lang
     pagedata = data.encode('utf-8')
 
-    authtrans = BasicAuthTransport(user, password)
-    wiki = xmlrpclib.ServerProxy("http://master.moinmo.in/?action=xmlrpc2", transport=authtrans)
-
-    rc = wiki.putPage(pagename, pagedata)
-    print "Page: %s rc=%s" % (pagename, rc)
+    wiki = xmlrpclib.ServerProxy("http://test17.moinmo.in/?action=xmlrpc2")
+    token = wiki.getAuthToken(user, password)
+    mc = xmlrpclib.MultiCall(wiki)
+    mc.applyAuthToken(token)
+    mc.WhoAmI() # then we see in the result if auth worked correctly!
+    mc.putPage(pagename, pagedata)
+    mc.deleteAuthToken(token)
+    result = mc()
+    print "Page: %s rc=%r" % (pagename, list(result))
 
 if __name__ == "__main__":
     pass