Revision: 7058
Author: alexsh
Date: 2009-07-14 07:32:04 +0000 (Tue, 14 Jul 2009)
Log Message:
-----------
Fix: some action run in POST method only, ref:/w/api.php documentatioin
Modified Paths:
--------------
trunk/pywikipedia/query.py
Modified: trunk/pywikipedia/query.py
===================================================================
--- trunk/pywikipedia/query.py 2009-07-13 20:33:34 UTC (rev 7057)
+++ trunk/pywikipedia/query.py 2009-07-14 07:32:04 UTC (rev 7058)
@@ -69,10 +69,18 @@
lastError = None
retry_idle_time = 5
+ postAC = [
+ 'edit', 'login', 'purge', 'rollback',
'delete', 'undelete', 'protect',
+ 'block', 'unblock', 'move',
'emailuser','import', 'userrights',
+ ]
+
while retryCount >= 0:
try:
jsontext = "Nothing received"
- jsontext = site.getUrl( path, retry=True, data=data )
+ if params['action'] in postAC:
+ res, jsontext = site.postData(path, urllib.urlencode(params.items()))
+ else:
+ jsontext = site.getUrl( path, retry=True, data=data )
# This will also work, but all unicode strings will need to be converted from
\u notation
# decodedObj = eval( jsontext )
Show replies by date