[Pywikipedia-l] SVN: [5486] trunk/pywikipedia/add_text.py

filnik at svn.wikimedia.org filnik at svn.wikimedia.org
Sat May 31 19:06:30 UTC 2008


Revision: 5486
Author:   filnik
Date:     2008-05-31 19:06:30 +0000 (Sat, 31 May 2008)

Log Message:
-----------
Adding put_async for the manual mode, letting it for the auto mode

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

Modified: trunk/pywikipedia/add_text.py
===================================================================
--- trunk/pywikipedia/add_text.py	2008-05-31 16:26:29 UTC (rev 5485)
+++ trunk/pywikipedia/add_text.py	2008-05-31 19:06:30 UTC (rev 5486)
@@ -25,6 +25,8 @@
 python add_text.py -cat:catname -summary:"Bot: Adding a template" -text:"{{Something}}" -except:"\{\{([Tt]emplate:|)[Ss]omething" -up
 
 # Command used on it.wikipedia to put the template in the page without any category.
+# But warning! Put it in a line, otherwise it won't work correctly.
+
 python add_text.py -excepturl:"<p class='catlinks'>" -uncat -text:"{{Categorizzare}}"
 -except:"\{\{([Tt]emplate:|)[Cc]ategorizzare" -summary:"Bot: Aggiungo template Categorizzare"
 
@@ -195,7 +197,10 @@
                 return (False, always)
             if choice == 'y' or always:
                 try:
-                    page.put(newtext, summary)
+                    if always:
+                        page.put(newtext, summary)
+                    else:
+                        page.put_async(newtext, summary)
                 except wikipedia.EditConflict:
                     wikipedia.output(u'Edit conflict! skip!')
                     return (False, always)





More information about the Pywikipedia-l mailing list