Patches item #1736292, was opened at 2007-06-13 03:48 Message generated for change (Settings changed) made by leogregianin You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603140&aid=1736292...
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: Accepted
Priority: 5 Private: No Submitted By: Purodha B Blissenbach (purodha) Assigned to: Nobody/Anonymous (nobody) Summary: Allow autosummary in pagefromfile.py (simple)
Initial Comment: Since Mediawiki offers to generate an automated edit summary for new pages, it may be desirable to let this freature be used in pageromfole.py - specifically with batch uploads, this would result often in more useful individual edit summaries, such as "redirects to [[xyzzy]]", etc.
The chance to make this possible is very simple. Here is a patch:
1. In the parameter description section, add two lines resulting in this:
-summary:xxx Use xxx as the summary for the upload if xxx is the empty string, and a new page is created, mediawikis autosummary feature generates a summary
2. Few lines before the end of pagefromfile.py, add two lines resulting in this code:
elif arg.startswith("-summary:"): commenttext=arg[9:] if commenttext == '': wikipedia.setAction('') else: wikipedia.output(u"Disregarding unknown argument %s." % arg)
3. This is already it.
----------------------------------------------------------------------
Comment By: Francesco Cosoleto (cosoleto) Date: 2007-10-01 14:16
Message: Logged In: YES user_id=181280 Originator: NO
Feature added in r4397.
----------------------------------------------------------------------
Comment By: Purodha B Blissenbach (purodha) Date: 2007-06-21 07:11
Message: Logged In: YES user_id=46450 Originator: YES
File Added: pagefromfile_summary_autosummary.py
----------------------------------------------------------------------
Comment By: Purodha B Blissenbach (purodha) Date: 2007-06-21 07:08
Message: Logged In: YES user_id=46450 Originator: YES
After the latest reworking of pagefromfile.py in cvs, which made the -summary command line parameter useless, my above recommendation was lost, and after reinserting it, did not work any more. Attached is a patch that makes both work as of today. File Added: pagefromfile_summary_autosummary.diff
----------------------------------------------------------------------
Comment By: Purodha B Blissenbach (purodha) Date: 2007-06-15 03:45
Message: Logged In: YES user_id=46450 Originator: YES
Yes, sure I tested it, see e.g. the summaries in this edit:
http://ksh.wikipedia.org/w/index.php?title=Ihrefeldt_%28K%C3%B6lle%29&ac...
and in this edit:
http://ksh.wikipedia.org/w/index.php?title=7._S%C3%ABpt%C3%A4mbo&action=...
Both have been created in one bot run. ("Leit öm op" = "Redirects to", localized)
When put() gets an *empty* or None comment parameter, it uses the action defined by setAction() which by default is something like "PyWikipediBot framework". This is why I made it empty, when commenttext==''.
put(... comment = '' ...) makes Mediawiki use its autosummary feature on new pages.
----------------------------------------------------------------------
Comment By: Daniel Herding (wikipedian) Date: 2007-06-14 06:35
Message: Logged In: YES user_id=880694 Originator: NO
Have you tested this? I'm not sure this works, as pages are saved using put(... comment = commenttext ...).
When put gets a comment parameter, it will ignore the action defined by the setAction() call.
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603140&aid=1736292...