http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10138
Revision: 10138
Author: xqt
Date: 2012-04-20 16:03:50 +0000 (Fri, 20 Apr 2012)
Log Message:
-----------
update mw release pre 1.20wmf1
Modified Paths:
--------------
trunk/pywikipedia/families/wikipedia_family.py
Modified: trunk/pywikipedia/families/wikipedia_family.py
===================================================================
--- trunk/pywikipedia/families/wikipedia_family.py 2012-04-20 15:37:37 UTC (rev 10137)
+++ trunk/pywikipedia/families/wikipedia_family.py 2012-04-20 16:03:50 UTC (rev 10138)
@@ -1486,6 +1486,12 @@
# xxwikipedia for Wikipedias.
return '%swiki_p' % code
+ def version(self, code):
+ """Return MediaWiki version number as a string."""
+ # Don't use this, use versionnumber() instead. This only exists
+ # to not break family files.
+ return '1.19wmf1'
+
def code2encodings(self, code):
"""Return a list of historical encodings for a specific language
wikipedia"""
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10137
Revision: 10137
Author: xqt
Date: 2012-04-20 15:37:37 +0000 (Fri, 20 Apr 2012)
Log Message:
-----------
Print additional informations
Modified Paths:
--------------
trunk/pywikipedia/archivebot.py
Modified: trunk/pywikipedia/archivebot.py
===================================================================
--- trunk/pywikipedia/archivebot.py 2012-04-20 10:59:32 UTC (rev 10136)
+++ trunk/pywikipedia/archivebot.py 2012-04-20 15:37:37 UTC (rev 10137)
@@ -543,7 +543,7 @@
if options.calc:
if not options.salt:
- parser.error('you must specify a salt to calculate a key')
+ parser.error('Note: you must specify a salt to calculate a key')
s = new_hash()
s.update(options.salt+'\n')
s.update(options.calc+'\n')
@@ -563,8 +563,12 @@
if options.lang:
Site = pywikibot.getSite(options.lang)
language = Site.language()
- if pywikibot.debug: print Site
+ if not args:
+ pywikibot.output(u'NOTE: you must specify a template to run the bot')
+ pywikibot.showHelp('archivebot')
+ return
+
for a in args:
pagelist = []
if not options.filename and not options.pagename:
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10136
Revision: 10136
Author: xqt
Date: 2012-04-20 10:59:32 +0000 (Fri, 20 Apr 2012)
Log Message:
-----------
enable regex/replacements as a dictionary for different langs
Modified Paths:
--------------
trunk/pywikipedia/replace.py
Modified: trunk/pywikipedia/replace.py
===================================================================
--- trunk/pywikipedia/replace.py 2012-04-18 16:22:51 UTC (rev 10135)
+++ trunk/pywikipedia/replace.py 2012-04-20 10:59:32 UTC (rev 10136)
@@ -855,9 +855,12 @@
caseInsensitive = fix['nocase']
try:
replacements = fix['replacements']
+ # enable regex/replacements as a dictionary for different langs
+ if isinstance(replacements, dict):
+ replacements = replacements[pywikibot.getSite().lang]
except KeyError:
pywikibot.output(
- u"No replacements given in fix, don't joke with me!")
+ u"No replacements given in fix, don't joke with me!")
return
# Set the regular expression flags
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10133
Revision: 10133
Author: xqt
Date: 2012-04-18 14:40:22 +0000 (Wed, 18 Apr 2012)
Log Message:
-----------
The first messages for user interface
Added Paths:
-----------
branches/rewrite/scripts/i18n/pywikibot.py
Added: branches/rewrite/scripts/i18n/pywikibot.py
===================================================================
--- branches/rewrite/scripts/i18n/pywikibot.py (rev 0)
+++ branches/rewrite/scripts/i18n/pywikibot.py 2012-04-18 14:40:22 UTC (rev 10133)
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*-
+msg = {
+ 'de': {
+ 'pywikibot-enter-category-name': u'Bitte Name der Kategorie eingeben:',
+ 'pywikibot-enter-file-links-processing': u'Links welcher Dateiseite sollen bearbeitet werden?',
+ 'pywikibot-enter-finished-browser': u'Enter drücken nach dem Beenden des Browsers.',
+ 'pywikibot-enter-namespace-number': u'Bitte gib die Nummer des Namensraums ein:',
+ 'pywikibot-enter-new-text': u'Bitte gib den neuen Text ein: ',
+ 'pywikibot-enter-page-processing': u'Welche Seite soll bearbeitet werden?',
+ 'pywikibot-enter-xml-filename': u'Bitte gib den Datenamen des XML-Dumps ein:',
+ },
+ 'en': {
+ 'pywikibot-enter-category-name': u'Please enter the category name:',
+ 'pywikibot-enter-file-links-processing': u'Links to which image page should be processed?',
+ 'pywikibot-enter-finished-browser': u'Press Enter when finished in browser.',
+ 'pywikibot-enter-namespace-number': u'Please enter a namespace by its number:',
+ 'pywikibot-enter-new-text': u'Please enter the new text:',
+ 'pywikibot-enter-page-processing': u'Which page should be processed?',
+ 'pywikibot-enter-xml-filename': u'Please enter the XML dump\'s filename:',
+ },
+ 'qqq': {
+ 'pywikibot-enter-category-name': u'Message displayed to the bot owner to enter the category name.',
+ 'pywikibot-enter-file-links-processing': u'Question displayed to the bot owner processing links to a given image page.',
+ 'pywikibot-enter-finished-browser': u'Message displayed to the bot owner to press Enter button when browser edits are finished.',
+ 'pywikibot-enter-namespace-number': u'Message displayed to the bot owner to enter a namespace by its number.',
+ 'pywikibot-enter-new-text': u'Message displayed to the bot owner to enter the new text.',
+ 'pywikibot-enter-page-processing': u'Question displayed to the bot owner which page should be processed.',
+ 'pywikibot-enter-xml-filename': u'Message displayed to the bot owner to enter the XML dump\'s filename.',
+ },
+}
Property changes on: branches/rewrite/scripts/i18n/pywikibot.py
___________________________________________________________________
Added: svn:eol-style
+ native