Bugs item #2030278, was opened at 2008-07-28 12:48
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2030278&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Purodha B Blissenbach (purodha)
Assigned to: Nobody/Anonymous (nobody)
Summary: "pre_put_convert" function missing from most families.
Initial Comment:
R5764 introduced a bug, for which I submitted a quick fix with R5766. I sincerely believe that, this was only a partial fix. Although it works for me using interwiki.py -familiy:wikipedia , I expect it to not cure the error for other wiki families, and possibly, this was not the best way to do it anyways.
Here is an output *before* my quick-and-dirty fix:
python /home/purodha/pywikipedia/interwiki.py -v -initialredirect Saachjrupp:Wikipedia:Medmaacher kann winnnish Hinndi
Checked for running processes. 1 processes currently running, including the current process.
Pywikipediabot (r5764 (wikipedia.py), Jul 27 2008, 11:04:03)
Python 2.5.2 (r252:60911, May 28 2008, 19:19:25)
[GCC 4.2.4 (Debian 4.2.4-1)]
Retrieving mediawiki messages from Special:Allmessages
WARNING: No character set found.
Getting 1 pages from wikipedia:ksh...
[[Saachjrupp:Wikipedia:Medmaacher kann winnnish Hinndi]]: [[ksh:Saachjrupp:Wikipedia:Medmaacher kann winnnish Hinndi]] gives new interwiki [[lt:Kategorija:User hi-1]]
[[Saachjrupp:Wikipedia:Medmaacher kann winnnish Hinndi]]: [[ksh:Saachjrupp:Wikipedia:Medmaacher kann winnnish Hinndi]] gives new interwiki [[zh:Category:Hi-1 ???]]
[[Saachjrupp:Wikipedia:Medmaacher kann winnnish Hinndi]]: [[ksh:Saachjrupp:Wikipedia:Medmaacher kann winnnish Hinndi]] gives new interwiki [[th:?????????:User hi-1]]
--- note, some 500 lines skipped ---
======Post-processing [[ksh:Saachjrupp:Wikipedia:Medmaacher kann winnnish Hinndi]]======
Updating links on page [[lt:Kategorija:User hi-1]].
Changes to be made: Pridedama: it, ksh, nl, no, pl, zh
- [[as:Category:User hi-1]]
+ [[as:??????:User hi-1]]
+ [[it:Categoria:Utenti hi-1]]
+ [[ksh:Saachjrupp:Wikipedia:Medmaacher kann winnnish Hinndi]]
- [[lad:Category:User hi-1]]
+ [[lad:Categoría:User hi-1]]
+ [[nl:Categorie:Gebruiker hi-1]]
+ [[no:Kategori:Bruker hi-1]]
+ [[pl:Kategoria:User hi-1]]
+ [[zh:Category:Hi-1 ???]]
NOTE: Updating live wiki...
Getting information for site wikipedia:lt
Copy of watchlist is one month old, reloading
Retrieving watchlist for wikipedia:lt
Parsing watchlist
Dump ksh (wikipedia) saved
Traceback (most recent call last):
File "/home/purodha/pywikipedia/interwiki.py", line 1755, in <module>
bot.run()
File "/home/purodha/pywikipedia/interwiki.py", line 1492, in run
self.queryStep()
File "/home/purodha/pywikipedia/interwiki.py", line 1471, in queryStep
subj.finish(self)
File "/home/purodha/pywikipedia/interwiki.py", line 1052, in finish
if self.replaceLinks(page, new, bot):
File "/home/purodha/pywikipedia/interwiki.py", line 1210, in replaceLinks
status, reason, data = page.put(newtext, comment = wikipedia.translate(page.site().lang, msg)[0] + mods)
File "/home/purodha/pywikipedia/wikipedia.py", line 1281, in put
newtext = self.site().pre_put_convert(newtext)
File "/home/purodha/pywikipedia/wikipedia.py", line 5754, in pre_put_convert
return self.family.pre_put_convert(self, putText)
AttributeError: Family instance has no attribute 'pre_put_convert'
#
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2030278&group_…
Feature Requests item #2029867, was opened at 2008-07-27 21:24
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603141&aid=2029867&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: interwiki
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: Mike.lifeguard (mike_lifeguard)
Assigned to: Nobody/Anonymous (nobody)
Summary: Bot to put the same text on the same page on every wiki
Initial Comment:
It should simply put the exact same text on the same page (accounting for namespace localization) on every wiki (or some specified subset). Should be easy to do for those knowing python. This would be useful to create template-like user/user talk pages, spamming messages cross-wiki, updating templates, updating blacklists (for stewards) etc. Mike.lifeguard | @meta 00:21, 28 July 2008 (UTC)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603141&aid=2029867&group_…
Revision: 5764
Author: valhallasw
Date: 2008-07-27 11:04:03 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
Added support for per-site post-get and pre-put conversions. Added automatic conversion for eowiki X-convention -> unicode
Modified Paths:
--------------
trunk/pywikipedia/families/wikipedia_family.py
trunk/pywikipedia/family.py
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/families/wikipedia_family.py
===================================================================
--- trunk/pywikipedia/families/wikipedia_family.py 2008-07-26 12:22:14 UTC (rev 5763)
+++ trunk/pywikipedia/families/wikipedia_family.py 2008-07-27 11:04:03 UTC (rev 5764)
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
import urllib
-import family, config
+import family, config, wikipedia
__version__ = '$Id$'
@@ -954,3 +954,9 @@
def shared_image_repository(self, code):
return ('commons', 'commons')
+
+ def post_get_convert(self, site, getText):
+ if site.lang == 'eo':
+ return wikipedia.decodeEsperantoX(getText)
+ else:
+ return getText
Modified: trunk/pywikipedia/family.py
===================================================================
--- trunk/pywikipedia/family.py 2008-07-26 12:22:14 UTC (rev 5763)
+++ trunk/pywikipedia/family.py 2008-07-27 11:04:03 UTC (rev 5764)
@@ -3183,3 +3183,13 @@
def isPublic(self):
"""Does the wiki require logging in before viewing it ?"""
return True
+
+ def post_get_convert(self, site, getText):
+ """Does a conversion on the retrieved text from the wiki
+ i.e. Esperanto X-conversion """
+ return getText
+
+ def pre_put_convert(self, site, putText):
+ """Does a conversion on the text to insert on the wiki
+ i.e. Esperanto X-conversion """
+ return putText
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2008-07-26 12:22:14 UTC (rev 5763)
+++ trunk/pywikipedia/wikipedia.py 2008-07-27 11:04:03 UTC (rev 5764)
@@ -782,7 +782,13 @@
else:
self._isWatched = False
# Now process the contents of the textarea
- m = self.site().redirectRegex().match(text[i1:i2])
+ # Unescape HTML characters, strip whitespace and postconvert
+ pagetext = text[i1:i2]
+ pagetext = unescape(pagetext)
+ pagetext = pagetext.strip()
+ pagetext = self.site().post_get_convert(pagetext)
+
+ m = self.site().redirectRegex().match(pagetext)
if m:
# page text matches the redirect pattern
if self.section() and not "#" in m.group(1):
@@ -801,13 +807,8 @@
self._getexception
except AttributeError:
raise SectionError # Page has no section by this name
- # TODO: Docu and rewrite also this as above.
- x = text[i1:i2]
- x = unescape(x)
- while x and x[-1] in '\n ':
- x = x[:-1]
- return x
+ return pagetext
def getOldVersion(self, oldid, force=False, get_redirect=False,
throttle=True, sysop=False, change_edit_time=True):
@@ -1277,6 +1278,7 @@
import watchlist
watchArticle = watchlist.isWatched(self.title(), site = self.site())
newPage = not self.exists()
+ newtext = self.site().pre_put_convert(newtext)
return self._putPage(newtext, comment, watchArticle, minorEdit,
newPage, self.site().getToken(sysop = sysop), sysop = sysop)
@@ -3954,6 +3956,11 @@
linktrail: Return regex for trailing chars displayed as part of a link.
disambcategory: Category in which disambiguation pages are listed.
+ post_get_convert: Converts text data from the site immediatly after get
+ i.e. EsperantoX -> unicode
+ pre_put_convert: Converts text data from the site immediatly before put
+ i.e. unicode -> EsperantoX
+
Methods that yield Page objects derived from a wiki's Special: pages
(note, some methods yield other information in a tuple along with the
Pages; see method docs for details) --
@@ -5739,7 +5746,13 @@
def linktrail(self):
"""Return regex for trailing chars displayed as part of a link."""
return self.family.linktrail(self.lang)
+
+ def post_get_convert(self, getText):
+ return self.family.post_get_convert(self, getText)
+ def pre_put_convert(self, putText):
+ return self.family.pre_put_convert(self, putText)
+
def language(self):
"""Return Site's language code."""
return self.lang
Bugs item #2028779, was opened at 2008-07-26 15:17
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2028779&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: interwiki
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: add gan: to chinese group
Initial Comment:
Please add 'gan:' to 'chinese' language group in family.py.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2028779&group_…
Feature Requests item #2028736, was opened at 2008-07-26 17:19
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603141&aid=2028736&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: Mohamed M. Kassem (alnokta)
Assigned to: Nobody/Anonymous (nobody)
Summary: Option to ignore interwiki links while using replace.py
Initial Comment:
Hello,
Please add an option to replace.py (or fixes.py, you know better) so that when it is making replacements, it ignores/untouches the interwiki links and leaves them as is.
Thanks,
alnokta
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603141&aid=2028736&group_…
Revision: 5762
Author: filnik
Date: 2008-07-26 09:46:04 +0000 (Sat, 26 Jul 2008)
Log Message:
-----------
fixing whitetemplates detection
Modified Paths:
--------------
trunk/pywikipedia/checkimages.py
Modified: trunk/pywikipedia/checkimages.py
===================================================================
--- trunk/pywikipedia/checkimages.py 2008-07-26 08:36:01 UTC (rev 5761)
+++ trunk/pywikipedia/checkimages.py 2008-07-26 09:46:04 UTC (rev 5762)
@@ -1234,7 +1234,7 @@
white_template_found = 0
for l in hiddentemplate:
if tagged == False:
- res = re.findall(r'\{\{(?:[Tt]emplate:|)%s(?: \n|\||\n|\})' % l.lower(), g.lower())
+ res = re.findall(r'\{\{(?:[Tt]emplate:|)%s[ \n]*?(?:\n|\||\})' % l.lower(), g.lower())
if res != []:
white_template_found += 1
if l != '' and l != ' ': # Check that l is not nothing or a space