Bugs item #1974164, was opened at 2008-05-27 07:05
Message generated for change (Comment added) made by siebrand
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1974164&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: Closed
Resolution: None
Priority: 5
Private: No
Submitted By: Melancholie (melancholie)
Assigned to: Nobody/Anonymous (nobody)
Summary: Move throttle.log into /logs
Initial Comment:
As throttle.log is a log, place it into the folder "logs" ;-)
----------------------------------------------------------------------
>Comment By: siebrand (siebrand)
Date: 2008-06-03 00:17
Message:
Logged In: YES
user_id=1107255
Originator: NO
Fixed in r5499
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1974164&group_…
Bugs item #1914247, was opened at 2008-03-14 12:51
Message generated for change (Comment added) made by siebrand
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1914247&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: None
Priority: 5
Private: No
Submitted By: Soroush (soroush)
Assigned to: Nobody/Anonymous (nobody)
Summary: i18n for Persian for redirect.py
Initial Comment:
Please add the following to redirect.py or replace the current version with the atatched file to solve Persian(=Farsi) translations:
for
'en': u'Robot: Fixing double redirect',
please add:
'fa': u'ربات:اصلاح تغییر مسیر دوتایی';
and for
'en': u'Robot: Redirect target doesn\'t exist',
add
'fa': u'ربات:تغییرمسیر مقصد ندارد';
----------------------------------------------------------------------
>Comment By: siebrand (siebrand)
Date: 2008-06-02 23:51
Message:
Logged In: YES
user_id=1107255
Originator: NO
Committed in r5497
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1914247&group_…
Bugs item #1982714, was opened at 2008-06-02 23:46
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=1982714&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: 8
Private: No
Submitted By: siebrand (siebrand)
Assigned to: Nobody/Anonymous (nobody)
Summary: Media on shared repos not recognised by framework
Initial Comment:
Sample command:
image.py -lang:eo "Japanio Jamaguchi mapo malgranda.png" "Japan yamaguchi map small.png"
Exits with:
Getting 1 pages from wikipedia:eo...
Page [[Dosiero:Japan yamaguchi map small.png]] not found
URLs:
* http://eo.wikipedia.org/wiki/Dosiero:Japanio_Jamaguchi_mapo_malgranda.png
* http://eo.wikipedia.org/wiki/Dosiero:Japan_yamaguchi_map_small.png
Since changes in ImagePage.php in MediaWiki (21 May, r35113-r35155) image.py and nowcommons.py no longer recognise media that are present on a shared media repository as available on a local wiki. This is a huge issue when cleaning up duplicate files with the same and different names.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1982714&group_…
Bugs item #1981416, was opened at 2008-06-01 19:49
Message generated for change (Comment added) made by nicdumz
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1981416&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: Fixed
Priority: 5
Private: No
Submitted By: Sébastien Rombauts (srombauts)
>Assigned to: NicDumZ — Nicolas Dumazet (nicdumz)
Summary: Add the get_redirect argument to categories() & templates()
Initial Comment:
There is a need to add the "get_redirect" argument (from the "get()" method) to the "categories()", "templates()" and "templatesWithParams()" methods.
This allow for getting categories and templates links from redirect pages, because sometimes they use some. At least do we use a lot of those "categories in redirect pages" to categories acronyms at work into our intern mediawiki installation
Please see the attached patch that I made from the last available svn revision, which currently is r5491.
It is a "svn diff" as short as possible, only 6 lines modified in "wikipedia.py" : each time the add of the argument to the method ("get_redirect=False") then its use when calling the the get() method (get_redirect=get_redirect)
Please note that :
* I added this "get_redirect" argument defaulted to "False"(ie. "get_redirect=False") because that way I am sure not to break anything elsewhere.
It is up to you whereas to default it to "True" or not.
* I added no comments about this new option, solely to reduce the "diff" file. Please let me know if its up to me to add the comment, then I will submit a new fully commented patch.
Best Regards,
SRombauts
----------------------------------------------------------------------
>Comment By: NicDumZ — Nicolas Dumazet (nicdumz)
Date: 2008-06-02 19:21
Message:
Logged In: YES
user_id=1963242
Originator: NO
Salut Sébastien ;)
I personally tend not to care about the size of the patch, if the size is
induced by some comments : the more comments we have, the better it is !
And, yes, the fact that the added parameters defaulted to False was indeed
appropriate here.
Something actually struck me reading your patch : Page::categories()
already had a nofollow_redirects parameter that seemed to implement the
behavior you were seeking. This lead me to some interesting findings in
wikipedia.py. Somehow we were duplicating get_redirect with
nofollow_redirects since... r2819 ! I implemented your suggestion, and
removed the duplicate arguments in r5496 (Read more about it in the
changelog here:
http://fisheye.toolserver.org/changelog/pywikipedia/?cs=5496 )
Merci pour l'idée, n'hésite pas à revenir ;)
-- Nicolas.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1981416&group_…
Revision: 5496
Author: nicdumz
Date: 2008-06-02 17:05:34 +0000 (Mon, 02 Jun 2008)
Log Message:
-----------
Follow up to S?\195?\169bastien Rombants' bug #1981416 [Add the get_redirect argument to categories() & templates()] :
* Adding get_redirect to Page::templates
* Page::categories already had the nofollow_redirects argument : I tried searching what was that confusing nofollow_redirects argument :
It turns out that nofollow_redirects was a Page::get() parameter that was used *exactly* as get_redirect, except on two Page::_getEditPage() lines :
if get_redirect:
self._redirarg = redirtarget
elif not nofollow_redirects:
raise IsRedirectPage(redirtarget)
The only difference was that get_redirect was setting Page::_redirarg whereas nofollow_redirects wasn't.
Now, searching a bit more in our codebase, the only access to Page::_redirarg was in Page::get() :
if hasattr(self, '_redirarg') and not get_redirect and not nofollow_redirects:
raise IsRedirectPage, self._redirarg
So, with nofollow_redirects=True, _redirarg wasnt set nor read, and IsRedirectPage was not ever raised.
Do you see a difference with the get_redirect=True behavior, where _redirarg is set but not read, and IsRedirectPage is not raised ?
I don't.
=> Removing the duplicate nofollow_redirects, to use instead get_redirect
Modified Paths:
--------------
trunk/pywikipedia/catlib.py
trunk/pywikipedia/commonsdelinker/delinker.py
trunk/pywikipedia/maintenance/readtalk.py
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/catlib.py
===================================================================
--- trunk/pywikipedia/catlib.py 2008-06-02 16:22:37 UTC (rev 5495)
+++ trunk/pywikipedia/catlib.py 2008-06-02 17:05:34 UTC (rev 5496)
@@ -407,7 +407,7 @@
oldCat and newCat should be Category objects.
If newCat is None, the category will be removed.
"""
- cats = article.categories(nofollow_redirects=True)
+ cats = article.categories(get_redirect=True)
site = article.site()
changesMade = False
@@ -415,7 +415,7 @@
wikipedia.output("Can't edit %s, skipping it..." & article.aslink())
return False
if inPlace == True:
- oldtext = article.get(nofollow_redirects=True)
+ oldtext = article.get(get_redirect=True)
newtext = wikipedia.replaceCategoryInPlace(oldtext, oldCat, newCat)
if newtext == oldtext:
wikipedia.output(
@@ -465,7 +465,7 @@
if not changesMade:
wikipedia.output(u'ERROR: %s is not in category %s!' % (article.aslink(), oldCat.title()))
else:
- text = article.get(nofollow_redirects=True)
+ text = article.get(get_redirect=True)
try:
text = wikipedia.replaceCategoryLinks(text, newCatList)
except ValueError:
Modified: trunk/pywikipedia/commonsdelinker/delinker.py
===================================================================
--- trunk/pywikipedia/commonsdelinker/delinker.py 2008-06-02 16:22:37 UTC (rev 5495)
+++ trunk/pywikipedia/commonsdelinker/delinker.py 2008-06-02 17:05:34 UTC (rev 5496)
@@ -176,7 +176,7 @@
# TODO: Per site config.
if page.namespace() in self.CommonsDelinker.config['delink_namespaces']:
try:
- text = page.get(nofollow_redirects = True)
+ text = page.get(get_redirect = True)
except wikipedia.NoPage:
return 'failed'
new_text = text
Modified: trunk/pywikipedia/maintenance/readtalk.py
===================================================================
--- trunk/pywikipedia/maintenance/readtalk.py 2008-06-02 16:22:37 UTC (rev 5495)
+++ trunk/pywikipedia/maintenance/readtalk.py 2008-06-02 17:05:34 UTC (rev 5496)
@@ -21,7 +21,7 @@
username = config.usernames[familyName][lang]
page = wikipedia.Page(site, u'User_Talk:' + username)
wikipedia.output(u'Reading talk page from ' + lang + u' ' + familyName)
- wikipedia.output(page.get (nofollow_redirects=True))
+ wikipedia.output(page.get (get_redirect=True))
if __name__ == "__main__":
try:
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2008-06-02 16:22:37 UTC (rev 5495)
+++ trunk/pywikipedia/wikipedia.py 2008-06-02 17:05:34 UTC (rev 5496)
@@ -576,7 +576,7 @@
return self.autoFormat()[0] is not None
def get(self, force=False, get_redirect=False, throttle=True,
- sysop=False, nofollow_redirects=False, change_edit_time=True):
+ sysop=False, change_edit_time=True):
"""Return the wiki-text of the page.
This will retrieve the page from the server if it has not been
@@ -592,18 +592,11 @@
target of the redirect, do not raise an exception.
If force is True, reload all page attributes, including
errors.
- If nofollow_redirects is True, ignore redirects entirely (do not
- raise an exception for redirects but do not mark the page as a
- redirect or save the redirect target page).
If change_edit_time is False, do not check this version for changes
before saving. This should be used only if the page has been loaded
previously.
"""
- # TODO: is the description of nofollow_redirects accurate? I can't
- # tell where nofollow_redirects is doing anything different than
- # get_redirect!
-
# NOTE: The following few NoPage exceptions could already be thrown at
# the Page() constructor. They are raised here instead for convenience,
# because all scripts are prepared for NoPage exceptions raised by
@@ -628,19 +621,17 @@
delattr(self,attr)
else:
# Make sure we re-raise an exception we got on an earlier attempt
- if hasattr(self, '_redirarg') and not get_redirect and not nofollow_redirects:
+ if hasattr(self, '_redirarg') and not get_redirect:
raise IsRedirectPage, self._redirarg
elif hasattr(self, '_getexception'):
if self._getexception == IsRedirectPage and get_redirect:
pass
- elif self._getexception == IsRedirectPage and nofollow_redirects:
- pass
else:
raise self._getexception
# Make sure we did try to get the contents once
if not hasattr(self, '_contents'):
try:
- self._contents = self._getEditPage(get_redirect = get_redirect, throttle = throttle, sysop = sysop, nofollow_redirects=nofollow_redirects)
+ self._contents = self._getEditPage(get_redirect = get_redirect, throttle = throttle, sysop = sysop)
hn = self.section()
if hn:
m = re.search("=+ *%s *=+" % hn, self._contents)
@@ -655,7 +646,7 @@
except IsRedirectPage, arg:
self._getexception = IsRedirectPage
self._redirarg = arg
- if not get_redirect and not nofollow_redirects:
+ if not get_redirect:
raise
except SectionError:
self._getexception = SectionError
@@ -663,8 +654,7 @@
return self._contents
def _getEditPage(self, get_redirect=False, throttle=True, sysop=False,
- oldid=None, nofollow_redirects=False,
- change_edit_time=True):
+ oldid=None, change_edit_time=True):
"""Get the contents of the Page via the edit page.
Do not use this directly, use get() instead.
@@ -801,7 +791,7 @@
redirtarget = m.group(1)
if get_redirect:
self._redirarg = redirtarget
- elif not nofollow_redirects:
+ else:
raise IsRedirectPage(redirtarget)
if self.section():
# TODO: What the hell is this? Docu please.
@@ -820,8 +810,7 @@
return x
def getOldVersion(self, oldid, force=False, get_redirect=False,
- throttle=True, sysop=False, nofollow_redirects=False,
- change_edit_time=True):
+ throttle=True, sysop=False, change_edit_time=True):
"""Return text of an old revision of this page; same options as get()."""
# TODO: should probably check for bad pagename, NoPage, and other
# exceptions that would prevent retrieving text, as get() does
@@ -831,7 +820,6 @@
return self._getEditPage(
get_redirect=get_redirect, throttle=throttle,
sysop=sysop, oldid=oldid,
- nofollow_redirects=nofollow_redirects,
change_edit_time=change_edit_time
)
@@ -1578,7 +1566,7 @@
% (self.aslink(), newSite, newTitle))
return result
- def categories(self, nofollow_redirects=False):
+ def categories(self, get_redirect=False):
"""Return a list of categories that the article is in.
This will retrieve the page text to do its work, so it can raise
@@ -1589,7 +1577,7 @@
"""
try:
- category_links_to_return = getCategoryLinks(self.get(nofollow_redirects=nofollow_redirects), self.site())
+ category_links_to_return = getCategoryLinks(self.get(get_redirect=get_redirect), self.site())
except NoPage:
category_links_to_return = []
return category_links_to_return
@@ -1682,14 +1670,14 @@
results.append(ImagePage(self.site(), ns + ':' + imageName))
return list(set(results))
- def templates(self):
+ def templates(self, get_redirect=False):
"""Return a list of titles (unicode) of templates used on this Page.
Template parameters are ignored.
"""
- return [template for (template, param) in self.templatesWithParams()]
+ return [template for (template, param) in self.templatesWithParams(get_redirect=get_redirect)]
- def templatesWithParams(self, thistxt=None):
+ def templatesWithParams(self, thistxt=None, get_redirect=False):
"""Return a list of templates used on this Page.
Return value is a list of tuples. There is one tuple for each use of
@@ -1701,7 +1689,7 @@
check_disambig = (thistxt is None)
if not thistxt:
try:
- thistxt = self.get()
+ thistxt = self.get(get_redirect=get_redirect)
except (IsRedirectPage, NoPage):
self._isDisambig = False
return []
Bugs item #1981451, was opened at 2008-06-01 21:02
Message generated for change (Comment added) made by nicdumz
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1981451&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: category
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Mikko Silvonen (silvonen)
>Assigned to: NicDumZ — Nicolas Dumazet (nicdumz)
Summary: Fix looping bug in catlib.py, add Finnish messages
Initial Comment:
I added some Finnish messages in my copy of category.py and catlib.py, but stumbled into a bug in catlib.py: the copyAndKeep method uses only the first template listed in cfdTemplates and returns True after the first round of the loop. It looks like an indentation error in the code.
See the attached patch for a fix (plus my Finnish translations of the messages).
----------------------------------------------------------------------
>Comment By: NicDumZ — Nicolas Dumazet (nicdumz)
Date: 2008-06-02 18:23
Message:
Logged In: YES
user_id=1963242
Originator: NO
mmm yes it looked like an indentation error...!
Patch applied in r5495... Thanks for sharing ;)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1981451&group_…