Revision: 5517
Author: multichill
Date: 2008-06-06 22:14:01 +0000 (Fri, 06 Jun 2008)
Log Message:
-----------
Added -imagelinks switch
Changed ImagesPageGenerator to return imagePage objects.
Modified Paths:
--------------
trunk/pywikipedia/pagegenerators.py
Modified: trunk/pywikipedia/pagegenerators.py
===================================================================
--- trunk/pywikipedia/pagegenerators.py 2008-06-05 18:12:56 UTC (rev 5516)
+++ trunk/pywikipedia/pagegenerators.py 2008-06-06 22:14:01 UTC (rev 5517)
@@ -74,6 +74,9 @@
-new Work on the 60 newest pages. If given as -new:x, will work
on the x newest pages.
+-imagelinks Work on all images that are linked from a certain page.
+ Argument can also be given as "-imagelinks:linkingpagetitle".
+
-newimages Work on the 100 newest images. If given as -newimages:x,
will work on the x newest images.
@@ -257,8 +260,8 @@
yield page
def ImagesPageGenerator(pageWithImages):
- for page in pageWithImages.imagelinks(followRedirects = False, loose = True):
- yield page
+ for imagePage in pageWithImages.imagelinks(followRedirects = False, loose = True):
+ yield imagePage
def UnusedFilesGenerator(number = 100, repeat = False, site = None, extension = None):
if site is None:
@@ -942,6 +945,12 @@
gen = NewpagesPageGenerator(number = int(arg[5:]))
else:
gen = NewpagesPageGenerator(number = 60)
+ elif arg.startswith('-imagelinks'):
+ imagelinkstitle = arg[len('-imagelinks:'):]
+ if not imagelinkstitle:
+ imagelinkstitle = wikipedia.input(u'Images on which page should be processed?')
+ imagelinksPage = wikipedia.Page(wikipedia.getSite(), imagelinkstitle)
+ gen = ImagesPageGenerator(imagelinksPage)
elif arg.startswith('-search'):
mediawikiQuery = arg[8:]
if not mediawikiQuery:
Bugs item #1987869, was opened at 2008-06-08 04:14
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=1987869&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: Nightshadow28 (nightshadow28)
Assigned to: Nobody/Anonymous (nobody)
Summary: featured.py sorts wrongly 3 letters language code & cat tag
Initial Comment:
featured.py sorts wrongly 3 letters language code and category tag.
If featured.py uses with -top option, the bot sorts wrongly 3 letters language code and category tag. (r5522, Python 2.5, ubuntu 8.04)
[http://ja.wikipedia.org/w/index.php?title=%E7%AC%AC%E4%BA%8C%E6%AC%A1%E4%B8…]
* The category tag ([[Category:第二次世界大戦]], means "World War II") should be placed before {{Link_FA}} and interwiki tag.
* ext, gan and szl has been put on the wrong place.
Thanks.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1987869&group_…
Bugs item #1987463, was opened at 2008-06-07 11:41
Message generated for change (Comment added) made by russblau
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1987463&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
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Nightshadow28 (nightshadow28)
Assigned to: Nobody/Anonymous (nobody)
Summary: editarticle.py aborts in in gui.py / +ja message
Initial Comment:
* editarticle aborts in gui.py. (r5519, Python 2.5, ubuntu 8.04)
John_doe@Hogehoge:~/pywikipedia_r5519$ python editarticle.py
Checked for running processes. 1 processes currently running, including the current process.
Page to edit: User:Tatsujin28/Sandbox
Traceback (most recent call last):
File "editarticle.py", line 186, in <module>
main()
File "editarticle.py", line 182, in main
app.run()
File "editarticle.py", line 168, in run
new = textEditor.edit(old)
File "editarticle.py", line 120, in edit
return self.restoreLinebreaks(wikipedia.ui.editText(text, jumpIndex = jumpIndex, highlight = highlight))
File "/home/John_doe/pywikipedia_r5519/userinterfaces/terminal_interface.py", line 281, in editText
editor = gui.EditBoxWindow()
File "/home/John_doe/pywikipedia_r5519/gui.py", line 255, in __init__
menubar = Menu(root)
NameError: global name 'root' is not defined
John_doe@Hogehoge:~/pywikipedia_r5519$
* And... I added Japanese language message for the bot (attached). If anyone has a time, please commit it. Its summary is below:
-----
msg = {
'ar': u'تعديل يدوي: %s',
'de': u'Manuelle Bearbeitung: %s',
'en': u'Manual edit: %s',
'he': u'עריכה ידנית: %s',
'ja': u'手動編集: %s',
'pt': u'Editando manualmente com bot: %s',
'sv': u'Manuell redigering: %s',
'is': u'Handvirk breyting: %s',
}
----------------------------------------------------------------------
>Comment By: Russell Blau (russblau)
Date: 2008-06-07 15:01
Message:
Logged In: YES
user_id=855050
Originator: NO
gui.py issue fixed in r5521; message in r5522
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1987463&group_…
Bugs item #1987372, was opened at 2008-06-07 09:30
Message generated for change (Comment added) made by russblau
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1987372&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
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Bernhard Mayr (falk_steinhauer)
Assigned to: Nobody/Anonymous (nobody)
Summary: Crash within gui.py and corresponding bugfix
Initial Comment:
Line 418 of gui.py ( root = Tk() ) needs to be moved to line 24.
Otherwise line 255 ( menubar = Menu(root) ) will leed to a crash if gui.py is used in editarticle.py or replace.py.
TRACEBACK of replace.py crash when chosing [e]dit:
>>> Benutzer:FalkBot/Spielwiese <<<
- *<font color=darkorange>[[Ork]]</font>
+ *<font color=darkorange>[[Schwert]]</font>
Do you want to accept these changes? ([y]es, [N]o, [e]dit, open in [b]rowser, [a
]ll, [q]uit) e
Traceback (most recent call last):
File "C:\Python\pywikipedia\replace.py", line 694, in <module>
main()
File "C:\Python\pywikipedia\replace.py", line 690, in main
bot.run()
File "C:\Python\pywikipedia\replace.py", line 390, in run
as_edited = editor.edit(original_text)
File "C:\Python\pywikipedia\editarticle.py", line 119, in edit
return self.restoreLinebreaks(wikipedia.ui.editText(text, jumpIndex = jumpIn
dex, highlight = highlight))
File "C:\Python\pywikipedia\userinterfaces\terminal_interface.py", line 281, i
n editText
editor = gui.EditBoxWindow()
File "C:\Python\pywikipedia\gui.py", line 255, in __init__
menubar = Menu(root)
NameError: global name 'root' is not defined
----------------------------------------------------------------------
>Comment By: Russell Blau (russblau)
Date: 2008-06-07 14:59
Message:
Logged In: YES
user_id=855050
Originator: NO
fixed in r5521; thanks for the report!
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1987372&group_…