Revision: 5914
Author: wikipedian
Date: 2008-09-22 16:15:37 +0000 (Mon, 22 Sep 2008)
Log Message:
-----------
Fixed the Esperanto X-convention bug [ 2006208 ] by rolling back many changes that
concerned Esperanto X-conv.
I fixed this on 2008-08-21 already, but somehow my commit seems to have failed
(sorry), so now I retry to commit it.
Modified Paths:
--------------
trunk/pywikipedia/families/wikipedia_family.py
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/families/wikipedia_family.py
===================================================================
--- trunk/pywikipedia/families/wikipedia_family.py 2008-09-22 09:58:41 UTC (rev 5913)
+++ trunk/pywikipedia/families/wikipedia_family.py 2008-09-22 16:15:37 UTC (rev 5914)
@@ -966,16 +966,4 @@
return self.code2encoding(code),
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
-
- def pre_put_convert(self, site, getText):
- if site.lang == 'eo':
- return wikipedia.encodeEsperantoX(getText)
- else:
- return getText
+ return ('commons', 'commons')
\ No newline at end of file
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2008-09-22 09:58:41 UTC (rev 5913)
+++ trunk/pywikipedia/wikipedia.py 2008-09-22 16:15:37 UTC (rev 5914)
@@ -799,12 +799,12 @@
else:
self._isWatched = False
# Now process the contents of the textarea
- # Unescape HTML characters, strip whitespace and postconvert
- pagetext = text[i1:i2]
- pagetext = unescape(pagetext)
- pagetext = pagetext.rstrip()
- pagetext = self.site().post_get_convert(pagetext)
-
+ # Unescape HTML characters, strip whitespace
+ pagetext = text[i1:i2]
+ pagetext = unescape(pagetext)
+ pagetext = pagetext.rstrip()
+ if self.site().lang == 'eo':
+ pagetext = decodeEsperantoX(pagetext)
m = self.site().redirectRegex().match(pagetext)
if m:
# page text matches the redirect pattern
@@ -1295,7 +1295,12 @@
import watchlist
watchArticle = watchlist.isWatched(self.title(), site = self.site())
newPage = not self.exists()
- newtext = self.site().pre_put_convert(newtext)
+ # if posting to an Esperanto wiki, we must e.g. write Bordeauxx instead
+ # of Bordeaux
+ if self.site().lang == 'eo':
+ newtext = encodeEsperantoX(newtext)
+ comment = encodeEsperantoX(comment)
+
return self._putPage(newtext, comment, watchArticle, minorEdit,
newPage, self.site().getToken(sysop = sysop), sysop = sysop)
@@ -2237,7 +2242,7 @@
reason = input(u'Please enter a reason for the deletion:')
answer = 'y'
if prompt and not hasattr(self.site(), '_noDeletePrompt'):
- answer = inputChoice(u'Do you want to delete %s?' % self.aslink(forceInterwiki = True), ['Yes', 'No', 'All'], ['Y', 'N', 'A'], 'N')
+ answer = inputChoice(u'Do you want to delete %s?' % self.aslink(forceInterwiki = True), ['yes', 'no', 'all'], ['y', 'N', 'a'], 'N')
if answer == 'a':
answer = 'y'
self.site()._noDeletePrompt = True
@@ -2939,6 +2944,9 @@
def getData(self):
address = self.site.export_address()
pagenames = [page.sectionFreeTitle() for page in self.pages]
+ # We need to use X convention for requested page titles.
+ if self.site.lang == 'eo':
+ pagenames = [encodeEsperantoX(pagetitle) for pagetitle in pagenames]
pagenames = u'\r\n'.join(pagenames)
if type(pagenames) is not unicode:
output(u'Warning: xmlreader.WikipediaXMLHandler.getData() got non-unicode page names. Please report this.')
@@ -3995,11 +4003,6 @@
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) --
@@ -5840,12 +5843,6 @@
"""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 #2552661, was opened at 2009-01-31 17:31
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=2552661&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: other
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Linar Khalitov (rubin16)
Assigned to: Nobody/Anonymous (nobody)
Summary: featured.py mistake
Initial Comment:
The comment to the edit in ru.wiki is wrong: it writes for example
17:22, 31 января 2009 (история) (разн.) м Арсенал (футбольный клуб, Лондон) (Робот: робот: избранная статья he:ארסנל)
and repeats робот twice (in English it would look like
Robot: robot: featured article ...)
So, please change in line 79
'ru': u'Робот: робот: избранная статья [[%s:%s]]',
and make it like
'ru': u'Робот: избранная статья [[%s:%s]]',
-------
Pywikipedia [http] trunk/pywikipedia (r6315, Jan 30 2009, 19:42:01)
Python 2.5.2 (r252:60911, Mar 27 2008, 17:57:18) [MSC v.1310 32 bit (Intel)]
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2552661&group_…
Bugs item #2550938, was opened at 2009-01-31 02:26
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=2550938&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: Lars Aronsson (aronsson)
Assigned to: Nobody/Anonymous (nobody)
Summary: Namespace has been renamed sq:Kategoria:
Initial Comment:
When I found out that the namespace sq:Kategori: on the Shqip (Albanian) Wikipedia apparently has been renamed to sq:Kategoria: I manually updated my copy of family.py and started to run interwiki.py. But soon after, other bots make my updates undone because they still believe it's called sq:Kategori:
The category talk namespace has also been renamed:
- 'sq': u'Kategori',
+ 'sq': u'Kategoria',
- 'sq': u'Kategori Diskutim',
+ 'sq': u'Kategoria diskutim',
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2550938&group_…
Bugs item #2157483, was opened at 2008-10-10 09:53
Message generated for change (Comment added) made by russblau
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2157483&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: General
Group: None
>Status: Closed
>Resolution: Out of Date
Priority: 6
Private: No
Submitted By: Mauro (mauro742)
Assigned to: Nobody/Anonymous (nobody)
Summary: Edit conflit prints html
Initial Comment:
When I want to save (put) a page and an edit conflit occurs, the framework prints the html code of edit conflit's page.
Pywikipedia [http] trunk/pywikipedia (r5945, Oct 10 2008, 11:16:07)
Python 2.5.2 (r252:60911, Sep 29 2008, 21:10:35)
[GCC 4.3.2]
----------------------------------------------------------------------
>Comment By: Russell Blau (russblau)
Date: 2009-01-30 14:49
Message:
The code has changed drastically since this was opened. If the problem
occurs again, please provide a more detailed report including version.py
output.
----------------------------------------------------------------------
Comment By: Mauro (mauro742)
Date: 2008-10-10 10:11
Message:
This is the output:
Changing page [[...page...]]
Changing page has failed. Retrying.
Getting a token.
Sleeping for 5.5 seconds, 2008-10-10 15:36:06
Changing page [[...page...]]
ERROR: Unexpected response from wiki server.
200 (OK)
then follow the html
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2157483&group_…
Bugs item #1984572, was opened at 2008-06-04 10:51
Message generated for change (Comment added) made by russblau
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1984572&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: General
Group: None
>Status: Closed
>Resolution: Out of Date
Priority: 7
Private: No
Submitted By: Woo-Jin Kim (kwj2772)
Assigned to: Nobody/Anonymous (nobody)
Summary: Unexpected response from wiki server
Initial Comment:
When I'm running interwikibot with SUL account, my bot has been disabled and show this message
ERROR: Unexpected response from wiki server
200 (OK)
and local MediaWiki message shown.
----------------------------------------------------------------------
>Comment By: Russell Blau (russblau)
Date: 2009-01-30 14:47
Message:
The code has been revised drastically since this bug was opened. If the
problem recurs, please provide a more detailed report including version.py
output and the command line that you were trying to run.
----------------------------------------------------------------------
Comment By: Francesco Cosoleto (cosoleto)
Date: 2008-06-12 03:38
Message:
Logged In: YES
user_id=181280
Originator: NO
I cannot see MediaWiki response. Please upload a file with this output.
----------------------------------------------------------------------
Comment By: Melancholie (melancholie)
Date: 2008-06-05 10:13
Message:
Logged In: YES
user_id=2089773
Originator: NO
OK, also happens to me (occasional).
----------------------------------------------------------------------
Comment By: Melancholie (melancholie)
Date: 2008-06-05 05:29
Message:
Logged In: YES
user_id=2089773
Originator: NO
Is your code up-to-date (SVN)?
This should have been fixed, already.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1984572&group_…
Bugs item #2164505, was opened at 2008-10-13 16:55
Message generated for change (Settings changed) made by russblau
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2164505&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: 7
Private: No
Submitted By: Purodha B Blissenbach (purodha)
Assigned to: Nobody/Anonymous (nobody)
Summary: interwiki.py deletes comment lines
Initial Comment:
interwiki.py removes comment lines which should remain where they are, see http://nn.wikipedia.org/w/index.php?title=Kategori%3AAfghanistan&diff=75132…
AndersL of the Nynorsk Wikipedia tells that, there were multiple such sinstances, see
http://ksh.wikipedia.org/w/index.php?title=Metmaacher_Klaaf%3APurodha&diff=…
The program version of the above sample was of that day, or the day before. I am updating the program for Purbo T daily from svn.
----------------------------------------------------------------------
Comment By: NicDumZ — Nicolas Dumazet (nicdumz)
Date: 2008-10-19 23:41
Message:
I have tried to track the bug ; attached is my attempt to reproduce it, on
the exact same page.
Somehow I cannot reproduce it... Am I missing something here ?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2164505&group_…
Bugs item #2064976, was opened at 2008-08-21 10:44
Message generated for change (Comment added) made by russblau
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2064976&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: General
Group: None
>Status: Closed
>Resolution: Works For Me
Priority: 7
Private: No
Submitted By: Multichill (multichill)
Assigned to: Nobody/Anonymous (nobody)
Summary: All pages soup problems
Initial Comment:
While running python2.4 imageuncat.py -start:Image:Chironomidae
Working on Image:Cicada.ogg
Got category Category:Images transwikied by BetacommandBot
Working on Image:Cicada.png
Got category Category:Magicicada
Working on Image:Cicada0001.jpg
Got category Category:Cicadellidae
Traceback (most recent call last):
File "/home/bot/pywikipedia/pagegenerators.py", line 755, in __iter__
for page in self.wrapped_gen:
File "/home/bot/pywikipedia/pagegenerators.py", line 688, in DuplicateFilterPageGenerator
for page in generator:
File "/home/bot/pywikipedia/pagegenerators.py", line 239, in AllpagesPageGenerator
for page in site.allpages(start = start, namespace = namespace, includeredirects = includeredirects):
File "/home/bot/pywikipedia/wikipedia.py", line 5169, in allpages
for p in soup.api.query.allpages:
AttributeError: 'NoneType' object has no attribute 'query'
'NoneType' object has no attribute 'query'
Pywikipedia [http] trunk/pywikipedia (r5827, Aug 21 2008, 14:32:44)
Python 2.4.4 (#1, Jun 11 2007, 23:35:50)
[GCC 3.3.3 (NetBSD nb3 20040520)]
Why are we using BeautifulSoup anyway? We dont need to screen-scrape the API.
----------------------------------------------------------------------
>Comment By: Russell Blau (russblau)
Date: 2009-01-30 14:44
Message:
>pagegenerators.py -start:Image:Chironomidae
Checked for running processes. 1 processes currently running, including
the current process.
File:Chiropotes aequatorialis map.png
File:Chiropotes chiropotes map.png
File:Chiropotes irrorata map.png
(etc.)
----------------------------------------------------------------------
Comment By: Stig Meireles Johansen (stigmj)
Date: 2008-08-21 15:00
Message:
Logged In: YES
user_id=2116333
Originator: NO
I did a quick hack myself before I saw this beautifulsoup-version. I did
it with json and simplejson ... I don't know which method is better, but
this beautifulsoup-version is prettier.. :)
----------------------------------------------------------------------
Comment By: Jitse Niesen (jitseniesen)
Date: 2008-08-21 12:19
Message:
Logged In: YES
user_id=194734
Originator: NO
I found something strange in allpages() which might have caused the
problem and fixed it a minute ago in r5829. However, I'm not sure that this
did cause the problem, so I'm leaving the bug open.
BeautifulSoup is used to parse the XML that the API provides. Do you think
it's the wrong tool (I honestly don't know)?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2064976&group_…