Bugs item #2082329, was opened at 2008-08-29 14:11
Message generated for change (Comment added) made by yannforget
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2082329&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: Uberfuzzy (uberfuzzy)
Assigned to: Nobody/Anonymous (nobody)
Summary: movepages.py with -del does not delete talk page redirect
Initial Comment:
Pywikipedia [http] trunk/pywikipedia (r5858, Aug 28 2008, 11:35:51)
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)]
when using the movepages.py script with the -del option to delete the leftover redirect, only the redirect for the page is deleted, but not the talk page redirect.
----------------------------------------------------------------------
Comment By: Yann Forget (yannforget)
Date: 2008-11-25 16:07
Message:
Thanks to Andre Engels who helped for this, please add to movepages.py:
86c86
< def __init__(self, generator, addprefix, delete, always,
skipredirects, summary, leaveRedirect):
---
> def __init__(self, generator, addprefix, delete, always,
skipredirects, summary):
93d92
< self.leaveRedirect = leaveRedirect
101c100
< if page.move(newPageTitle, msg, throttle=True,
leaveRedirect=self.leaveRedirect) and self.delete:
---
> if page.move(newPageTitle, msg, throttle=True) and
self.delete:
223d221
< leaveRedirect = True
249,250d246
< elif arg == '-noredirect':
< leaveRedirect = False
284c280
< bot = MovePagesBot(None, prefix, delete, always, skipredirects,
summary, leaveRedirect)
---
> bot = MovePagesBot(None, prefix, delete, always, skipredirects,
summary)
288c284
< bot = MovePagesBot(preloadingGen, prefix, delete, always,
skipredirects, summary, leaveRedirect)
---
> bot = MovePagesBot(preloadingGen, prefix, delete, always,
skipredirects, summary)
----------------------------------------------------------------------
Comment By: Yann Forget (yannforget)
Date: 2008-11-25 13:40
Message:
https://sourceforge.net/tracker/index.php?func=detail&aid=2255146&group_id=…
----------------------------------------------------------------------
Comment By: Multichill (multichill)
Date: 2008-11-13 13:06
Message:
Mediawiki now supports moving pages without leaving redirects for bots.
Maybe the -del option should just move the page with this option enabled,
save you the deleting of a useless page.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2082329&group_…
Feature Requests item #2255146, was opened at 2008-11-10 12:44
Message generated for change (Comment added) made by yannforget
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603141&aid=2255146&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: Closed
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Multichill (multichill)
Summary: Page moves should not suppress redirects by default
Initial Comment:
When moving pages with Page.move(), a redirect should be created by default. Users with the 'suppressredirect' right (e.g. bots on Wikimedia projects) should be able to suppress redirects. I propose adding a parameter leaveRedirect=True (or possibly suppresRedirect=False) to the function.
----------------------------------------------------------------------
Comment By: Yann Forget (yannforget)
Date: 2008-11-25 15:59
Message:
Thanks to Andre Engels who helped for this, please add to movepages.py:
86c86
< def __init__(self, generator, addprefix, delete, always,
skipredirects, summary, leaveRedirect):
---
> def __init__(self, generator, addprefix, delete, always,
skipredirects, summary):
93d92
< self.leaveRedirect = leaveRedirect
101c100
< if page.move(newPageTitle, msg, throttle=True,
leaveRedirect=self.leaveRedirect) and self.delete:
---
> if page.move(newPageTitle, msg, throttle=True) and
self.delete:
223d221
< leaveRedirect = True
249,250d246
< elif arg == '-noredirect':
< leaveRedirect = False
284c280
< bot = MovePagesBot(None, prefix, delete, always, skipredirects,
summary, leaveRedirect)
---
> bot = MovePagesBot(None, prefix, delete, always, skipredirects,
summary)
288c284
< bot = MovePagesBot(preloadingGen, prefix, delete, always,
skipredirects, summary, leaveRedirect)
---
> bot = MovePagesBot(preloadingGen, prefix, delete, always,
skipredirects, summary)
----------------------------------------------------------------------
Comment By: Yann Forget (yannforget)
Date: 2008-11-25 13:41
Message:
https://sourceforge.net/tracker/index.php?func=detail&aid=2082329&group_id=…
----------------------------------------------------------------------
Comment By: Multichill (multichill)
Date: 2008-11-13 12:44
Message:
In svn revision 6084 i implemented leaveRedirect. By default this is true.
def move(self, newtitle, reason=None, movetalkpage=True, sysop=False,
- throttle=True, deleteAndMove=False, safe=True,
fixredirects=True):
+ throttle=True, deleteAndMove=False, safe=True,
fixredirects=True, leaveRedirect=True):
"""Move this page to new title given by newtitle. If safe, don't
try
to move and delete if not directly requested.
@@ -2226,6 +2226,10 @@
predata['wpFixRedirects'] = '1'
else:
predata['wpFixRedirects'] = '0'
+ if leaveRedirect:
+ predata['wpLeaveRedirect'] = '1'
+ else:
+ predata['wpLeaveRedirect'] = '0'
if token:
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603141&aid=2255146&group_…
Feature Requests item #2255146, was opened at 2008-11-10 12:44
Message generated for change (Comment added) made by yannforget
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603141&aid=2255146&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: Closed
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Multichill (multichill)
Summary: Page moves should not suppress redirects by default
Initial Comment:
When moving pages with Page.move(), a redirect should be created by default. Users with the 'suppressredirect' right (e.g. bots on Wikimedia projects) should be able to suppress redirects. I propose adding a parameter leaveRedirect=True (or possibly suppresRedirect=False) to the function.
----------------------------------------------------------------------
Comment By: Yann Forget (yannforget)
Date: 2008-11-25 13:41
Message:
https://sourceforge.net/tracker/index.php?func=detail&aid=2082329&group_id=…
----------------------------------------------------------------------
Comment By: Multichill (multichill)
Date: 2008-11-13 12:44
Message:
In svn revision 6084 i implemented leaveRedirect. By default this is true.
def move(self, newtitle, reason=None, movetalkpage=True, sysop=False,
- throttle=True, deleteAndMove=False, safe=True,
fixredirects=True):
+ throttle=True, deleteAndMove=False, safe=True,
fixredirects=True, leaveRedirect=True):
"""Move this page to new title given by newtitle. If safe, don't
try
to move and delete if not directly requested.
@@ -2226,6 +2226,10 @@
predata['wpFixRedirects'] = '1'
else:
predata['wpFixRedirects'] = '0'
+ if leaveRedirect:
+ predata['wpLeaveRedirect'] = '1'
+ else:
+ predata['wpLeaveRedirect'] = '0'
if token:
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603141&aid=2255146&group_…
Bugs item #2082329, was opened at 2008-08-29 14:11
Message generated for change (Comment added) made by yannforget
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2082329&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: Uberfuzzy (uberfuzzy)
Assigned to: Nobody/Anonymous (nobody)
Summary: movepages.py with -del does not delete talk page redirect
Initial Comment:
Pywikipedia [http] trunk/pywikipedia (r5858, Aug 28 2008, 11:35:51)
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)]
when using the movepages.py script with the -del option to delete the leftover redirect, only the redirect for the page is deleted, but not the talk page redirect.
----------------------------------------------------------------------
Comment By: Yann Forget (yannforget)
Date: 2008-11-25 13:40
Message:
https://sourceforge.net/tracker/index.php?func=detail&aid=2255146&group_id=…
----------------------------------------------------------------------
Comment By: Multichill (multichill)
Date: 2008-11-13 13:06
Message:
Mediawiki now supports moving pages without leaving redirects for bots.
Maybe the -del option should just move the page with this option enabled,
save you the deleting of a useless page.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2082329&group_…
Bugs item #2114223, was opened at 2008-09-16 16:46
Message generated for change (Comment added) made by silvonen
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2114223&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: André Malafaya Baptista (malafaya)
Assigned to: Nobody/Anonymous (nobody)
Summary: Socket timeout breaks out
Initial Comment:
VERSION.PY
==========
Pywikipedia [svn+ssh] wikimedia/svnroot/pywikipedia/trunk/pywikipedia (r5898, Se
p 16 2008, 11:50:17)
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]
DESCRIPTION
===========
It's been happening in the past days that a socket timeout interrupts the bot. I believe the stack trace below is self-explanatory.
I used the command line:
interwiki.py -family:wiktionary -autonomous -start:Category:! -lang:io
OUTPUT
======
NOTE: The first unfinished subject is [[io:Kategorio:Albaniana vorti]]
NOTE: Number of pages queued is 59, trying to add 60 more.
Sleeping for 4.1 seconds, 2008-09-16 14:31:06
Dump io (wiktionary) saved
Traceback (most recent call last):
File "D:\Work\pywikipediabot-HEAD\pywikipedia\interwiki.py", line 1735, in <module>
bot.run()
File "D:\Work\pywikipediabot-HEAD\pywikipedia\interwiki.py", line 1486, in run
self.queryStep()
File "D:\Work\pywikipediabot-HEAD\pywikipedia\interwiki.py", line 1460, in queryStep
self.oneQuery()
File "D:\Work\pywikipediabot-HEAD\pywikipedia\interwiki.py", line 1428, in oneQuery
site = self.selectQuerySite()
File "D:\Work\pywikipediabot-HEAD\pywikipedia\interwiki.py", line 1402, in selectQuerySite
self.generateMore(globalvar.maxquerysize - mycount)
File "D:\Work\pywikipediabot-HEAD\pywikipedia\interwiki.py", line 1336, in generateMore
page = self.pageGenerator.next()
File "D:\Work\pywikipediabot-HEAD\pywikipedia\pagegenerators.py", line 688, in
DuplicateFilterPageGenerator
for page in generator:
File "D:\Work\pywikipediabot-HEAD\pywikipedia\pagegenerators.py", line 239, in
AllpagesPageGenerator
for page in site.allpages(start = start, namespace = namespace, includeredir
ects = includeredirects):
File "D:\Work\pywikipediabot-HEAD\pywikipedia\wikipedia.py", line 5166, in allpages
text = self.getUrl(api_url)
File "D:\Work\pywikipediabot-HEAD\pywikipedia\wikipedia.py", line 4485, in getUrl
text = f.read()
File "D:\Program Files\Python\lib\socket.py", line 291, in read
data = self._sock.recv(recv_size)
socket.timeout: timed out
----------------------------------------------------------------------
Comment By: Mikko Silvonen (silvonen)
Date: 2008-11-24 21:31
Message:
My autonomous run was interrupted twice today because of a socket timeout.
I think the problem is server-related, as I have a 110 Mbps / 5 Mbps
connection.
Traceback (most recent call last):
File "interwiki.py", line 1769, in <module>
bot.run()
File "interwiki.py", line 1518, in run
self.queryStep()
File "interwiki.py", line 1492, in queryStep
self.oneQuery()
File "interwiki.py", line 1488, in oneQuery
subject.workDone(self)
File "interwiki.py", line 792, in workDone
iw = page.interwiki()
File "c:\svn\pywikipedia\wikipedia.py", line 1691, in interwiki
ll = getLanguageLinks(self.get(), insite=self.site(),
File "c:\svn\pywikipedia\wikipedia.py", line 668, in get
self._contents = self._getEditPage(get_redirect = get_redirect,
throttle = throttle, sysop = sysop)
File "c:\svn\pywikipedia\wikipedia.py", line 712, in _getEditPage
text = self.site().getUrl(path, sysop = sysop)
File "c:\svn\pywikipedia\wikipedia.py", line 4589, in getUrl
text = f.read()
File "C:\Python25\lib\socket.py", line 291, in read
data = self._sock.recv(recv_size)
socket.timeout: timed out
C:\svn\pywikipedia>python version.py
Pywikipedia [http] trunk/pywikipedia (r6114, Nov 23 2008, 12:41:02)
Python 2.5.1 (r251:54863, May 1 2007, 17:47:05) [MSC v.1310 32 bit
(Intel)]
----------------------------------------------------------------------
Comment By: NicDumZ — Nicolas Dumazet (nicdumz)
Date: 2008-09-20 04:41
Message:
the pagegenerator, even with the new api implementation, seems to be
working, I'm currently listing the pages of eo.wikt without any timeout.
Your connection might just be slower than usual ? Or does it timeout when
the WM websites are under heavy load ?
You can tweak the socket timeout in user-config.py, setting socket_timeout
to the number of seconds to wait (default is 120 seconds, quite long...)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2114223&group_…
Revision: 6115
Author: russblau
Date: 2008-11-23 16:52:20 +0000 (Sun, 23 Nov 2008)
Log Message:
-----------
templatesWithParams
Modified Paths:
--------------
branches/rewrite/pywikibot/page.py
Modified: branches/rewrite/pywikibot/page.py
===================================================================
--- branches/rewrite/pywikibot/page.py 2008-11-23 12:41:02 UTC (rev 6114)
+++ branches/rewrite/pywikibot/page.py 2008-11-23 16:52:20 UTC (rev 6115)
@@ -756,7 +756,25 @@
parameters as the second entry.
"""
- return self.site().templates_with_params(self)
+ templates = pywikibot.textlib.extract_templates_and_params(self.text)
+ # backwards-compatibility: convert the dict returned as the second
+ # element into a list in the format used by old scripts
+ result = []
+ for template in templates:
+ args = template[1]
+ positional = []
+ named = {}
+ for key in sorted(args.keys()):
+ try:
+ int(key)
+ except ValueError:
+ named[key] = args[key]
+ else:
+ positional.append(args[key])
+ for pos in positional:
+ named.append("%s=%s" % (pos, positional[pos]))
+ result.append(template[0], named)
+ return result
def categories(self, nofollow_redirects=None, withSortKey=False):
"""Iterate categories that the article is in.