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 #2358060, was opened at 2008-11-29 15:41
Message generated for change (Settings changed) made by matsubaray
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2358060&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: matsubaray (matsubaray)
Assigned to: Nobody/Anonymous (nobody)
>Summary: fix regexp for Watchlists
Initial Comment:
The regexp pattern for watchlists seems to be obsolete, at least in jawiki, jawikt and enwikt.
I guess this is because of changes in the monobook skin, but I don't know in detail.
Attatched diff tries to support both of the old and the new syntax of Watchlist's HTML.
----------------------------------------------------------------------
Comment By: matsubaray (matsubaray)
Date: 2008-11-29 15:45
Message:
Sorry. I forgot to report the output of version.py:
Pywikipedia [http] trunk/pywikipedia (r6119, Nov 25 2008, 18:43:39)
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)]
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2358060&group_…
Bugs item #2358060, was opened at 2008-11-29 15:41
Message generated for change (Comment added) made by matsubaray
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2358060&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: matsubaray (matsubaray)
Assigned to: Nobody/Anonymous (nobody)
Summary: fix regexp or Watchlists
Initial Comment:
The regexp pattern for watchlists seems to be obsolete, at least in jawiki, jawikt and enwikt.
I guess this is because of changes in the monobook skin, but I don't know in detail.
Attatched diff tries to support both of the old and the new syntax of Watchlist's HTML.
----------------------------------------------------------------------
Comment By: matsubaray (matsubaray)
Date: 2008-11-29 15:45
Message:
Sorry. I forgot to report the output of version.py:
Pywikipedia [http] trunk/pywikipedia (r6119, Nov 25 2008, 18:43:39)
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)]
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2358060&group_…
Bugs item #2358060, was opened at 2008-11-29 15:41
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=2358060&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: matsubaray (matsubaray)
Assigned to: Nobody/Anonymous (nobody)
Summary: fix regexp or Watchlists
Initial Comment:
The regexp pattern for watchlists seems to be obsolete, at least in jawiki, jawikt and enwikt.
I guess this is because of changes in the monobook skin, but I don't know in detail.
Attatched diff tries to support both of the old and the new syntax of Watchlist's HTML.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2358060&group_…
Bugs item #2356220, was opened at 2008-11-29 00:42
Message generated for change (Comment added) made by wikishizhao
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2356220&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: Open
Resolution: None
Priority: 7
Private: No
Submitted By: shizhao (wikishizhao)
Assigned to: Nobody/Anonymous (nobody)
Summary: fix newpages()
Initial Comment:
fix username in newpages() on wikipedia.py
----------------------------------------------------------------------
>Comment By: shizhao (wikishizhao)
Date: 2008-11-29 12:30
Message:
is python 2.5+. This Mediawiki update add class="mw-userlink" and
class="new mw-userlink", so pywikipedia also update.
----------------------------------------------------------------------
Comment By: Legoktm (legoktm)
Date: 2008-11-29 12:01
Message:
What version of python are you using? I get this error while running
2.3.5, but not with 2.5+.
----------------------------------------------------------------------
Comment By: Legoktm (legoktm)
Date: 2008-11-29 12:01
Message:
What version of python are you using? I get this error while running
2.3.5, but not with 2.5+.
----------------------------------------------------------------------
Comment By: Legoktm (legoktm)
Date: 2008-11-29 11:58
Message:
whoops, wrong bug
----------------------------------------------------------------------
Comment By: Legoktm (legoktm)
Date: 2008-11-29 11:58
Message:
What version of python are you using? I get this error while running
2.3.5, but not with 2.5+.
----------------------------------------------------------------------
Comment By: shizhao (wikishizhao)
Date: 2008-11-29 01:07
Message:
add fix new user.
File Added: wikipedia.diff
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2356220&group_…
Bugs item #2355848, was opened at 2008-11-28 21:56
Message generated for change (Comment added) made by wikishizhao
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2355848&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: Open
Resolution: None
Priority: 5
Private: No
Submitted By: shizhao (wikishizhao)
Assigned to: Nobody/Anonymous (nobody)
Summary: templates() BUG
Initial Comment:
templates() BUG on wikipedia.py:
$ python clean_sandbox.py
Traceback (most recent call last):
File "clean_sandbox.py", line 24, in ?
import wikipedia
File "/home/.chanel/shizhao/pywikipedia/wikipedia.py", line 1827
for (template, param)
^
SyntaxError: invalid syntax
plese Fix!
----------------------------------------------------------------------
>Comment By: shizhao (wikishizhao)
Date: 2008-11-29 12:27
Message:
yes, python 2.3.5
----------------------------------------------------------------------
Comment By: shizhao (wikishizhao)
Date: 2008-11-29 12:26
Message:
yes, python 2.3.5
----------------------------------------------------------------------
Comment By: Legoktm (legoktm)
Date: 2008-11-29 11:59
Message:
What version of python are you using? I get this error while running
2.3.5, but not with 2.5+.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2355848&group_…
Bugs item #2355848, was opened at 2008-11-28 21:56
Message generated for change (Comment added) made by wikishizhao
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2355848&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: Open
Resolution: None
Priority: 5
Private: No
Submitted By: shizhao (wikishizhao)
Assigned to: Nobody/Anonymous (nobody)
Summary: templates() BUG
Initial Comment:
templates() BUG on wikipedia.py:
$ python clean_sandbox.py
Traceback (most recent call last):
File "clean_sandbox.py", line 24, in ?
import wikipedia
File "/home/.chanel/shizhao/pywikipedia/wikipedia.py", line 1827
for (template, param)
^
SyntaxError: invalid syntax
plese Fix!
----------------------------------------------------------------------
>Comment By: shizhao (wikishizhao)
Date: 2008-11-29 12:26
Message:
yes, python 2.3.5
----------------------------------------------------------------------
Comment By: Legoktm (legoktm)
Date: 2008-11-29 11:59
Message:
What version of python are you using? I get this error while running
2.3.5, but not with 2.5+.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2355848&group_…
Bugs item #2356220, was opened at 2008-11-28 08:42
Message generated for change (Comment added) made by legoktm
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2356220&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: Open
Resolution: None
Priority: 7
Private: No
Submitted By: shizhao (wikishizhao)
Assigned to: Nobody/Anonymous (nobody)
Summary: fix newpages()
Initial Comment:
fix username in newpages() on wikipedia.py
----------------------------------------------------------------------
Comment By: Legoktm (legoktm)
Date: 2008-11-28 20:01
Message:
What version of python are you using? I get this error while running
2.3.5, but not with 2.5+.
----------------------------------------------------------------------
Comment By: Legoktm (legoktm)
Date: 2008-11-28 20:01
Message:
What version of python are you using? I get this error while running
2.3.5, but not with 2.5+.
----------------------------------------------------------------------
Comment By: Legoktm (legoktm)
Date: 2008-11-28 19:58
Message:
whoops, wrong bug
----------------------------------------------------------------------
Comment By: Legoktm (legoktm)
Date: 2008-11-28 19:58
Message:
What version of python are you using? I get this error while running
2.3.5, but not with 2.5+.
----------------------------------------------------------------------
Comment By: shizhao (wikishizhao)
Date: 2008-11-28 09:07
Message:
add fix new user.
File Added: wikipedia.diff
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2356220&group_…
Bugs item #2356220, was opened at 2008-11-28 08:42
Message generated for change (Comment added) made by legoktm
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2356220&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: Open
Resolution: None
Priority: 7
Private: No
Submitted By: shizhao (wikishizhao)
Assigned to: Nobody/Anonymous (nobody)
Summary: fix newpages()
Initial Comment:
fix username in newpages() on wikipedia.py
----------------------------------------------------------------------
Comment By: Legoktm (legoktm)
Date: 2008-11-28 20:01
Message:
What version of python are you using? I get this error while running
2.3.5, but not with 2.5+.
----------------------------------------------------------------------
Comment By: Legoktm (legoktm)
Date: 2008-11-28 19:58
Message:
whoops, wrong bug
----------------------------------------------------------------------
Comment By: Legoktm (legoktm)
Date: 2008-11-28 19:58
Message:
What version of python are you using? I get this error while running
2.3.5, but not with 2.5+.
----------------------------------------------------------------------
Comment By: shizhao (wikishizhao)
Date: 2008-11-28 09:07
Message:
add fix new user.
File Added: wikipedia.diff
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2356220&group_…