[Pywikipedia-l] SVN: [6570] trunk/pywikipedia/wikipedia.py

nicdumz at svn.wikimedia.org nicdumz at svn.wikimedia.org
Sat Apr 4 02:09:24 UTC 2009


Revision: 6570
Author:   nicdumz
Date:     2009-04-04 02:09:24 +0000 (Sat, 04 Apr 2009)

Log Message:
-----------
wikipedia.put: Adding possibility to edit without activating the bot flag
([ 2728152 ] Proposed patch for allowing edits without bot flag, by Tieum P)

Modified Paths:
--------------
    trunk/pywikipedia/wikipedia.py

Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py	2009-04-03 16:17:41 UTC (rev 6569)
+++ trunk/pywikipedia/wikipedia.py	2009-04-04 02:09:24 UTC (rev 6570)
@@ -1358,7 +1358,7 @@
                             force, callback))
 
     def put(self, newtext, comment=None, watchArticle=None, minorEdit=True,
-            force=False, sysop=False):
+            force=False, sysop=False, botflag=True):
         """Save the page with the contents of the first argument as the text.
 
         Optional parameters:
@@ -1416,7 +1416,7 @@
             comment = encodeEsperantoX(comment)
 
         return self._putPage(newtext, comment, watchArticle, minorEdit,
-                             newPage, self.site().getToken(sysop = sysop), sysop = sysop)
+                             newPage, self.site().getToken(sysop = sysop), sysop = sysop, botflag=botflag)
 
     def _encodeArg(self, arg, msgForError):
         """Encode an ascii string/Unicode string to the site's encoding"""
@@ -1434,7 +1434,7 @@
 
     def _putPage(self, text, comment=None, watchArticle=False, minorEdit=True,
                 newPage=False, token=None, newToken=False, sysop=False,
-                captcha=None):
+                captcha=None, botflag=True):
         """Upload 'text' as new content of Page by filling out the edit form.
 
         Don't use this directly, use put() instead.
@@ -1451,6 +1451,8 @@
             # We will need to fill this more smartly if we ever decide to edit by section
             'wpSection': '', 
         }
+        if not botflag:
+            predata['bot']='0'
         if captcha:
             predata["wpCaptchaId"] = captcha['id']
             predata["wpCaptchaWord"] = captcha['answer']





More information about the Pywikipedia-l mailing list