On the rewrite branch, how does one suppress the 20+ lines of logging
header that are output at the beginning of every script?
--
Russell Blau
russblau(a)imapmail.org
Hi,
Thanks for your reply. My bot works currently at meta.wikimedia.org (Meta-Wiki). The speedy deletion tag is {{delete}} and accepts optional comments such as {{delete|1=Broken redirect.}}.
Regards,
M
----- Mensaje original -----
De: pywikipedia-l-request(a)lists.wikimedia.org
Enviado: 13-05-13 14:00
Para: pywikipedia-l(a)lists.wikimedia.org
Asunto: Pywikipedia-l Digest, Vol 70, Issue 9
Send Pywikipedia-l mailing list submissions to pywikipedia-l(a)lists.wikimedia.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l or, via email, send a message with subject or body 'help' to pywikipedia-l-request(a)lists.wikimedia.org You can reach the person managing the list at pywikipedia-l-owner(a)lists.wikimedia.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Pywikipedia-l digest..." Today's Topics: 1. Re: redirect.py should (or at least give you the option to) tag for deletion broken redirects if the bot has not sysop rights (info(a)gno.de) 2. Re: Two wikidata bots (Jan Dudík) ---------------------------------------------------------------------- Message: 1 Date: Sun, 12 May 2013 17:58:20 +0200 (CEST) From: info(a)gno.de To: pywikipedia-l(a)lists.wikimedia.org Subject: Re: [Pywikipedia-l] redirect.py should (or at least give you the option to) tag for deletion broken redirects if the bot has not sysop rights Message-ID: <215129750.383650.1368374300935.JavaMail.ngmail(a)webmail08.arcor-online.net> Content-Type: text/plain; charset=ISO-8859-1 This behaviour was not changed in past. Maybe the corresponding deletion tag has been changed. At which wiki are you working whith it? xqt ----- Original Nachricht ---- Von: Marco Aurelio <maurelio(a)gmx.es> An: Lista pywikibot <pywikipedia-l(a)lists.wikimedia.org> Datum: 10.05.2013 19:36 Betreff: [Pywikipedia-l] redirect.py should (or at least give you the option to) tag for deletion broken redirects if the bot has not sysop rights > Hi, > > I run my bot in some projects where I do handle broken/double redirects > repairs. IIRC in the past the redirect.py script did tagged for deletion the > broken redirects if the bot didn't had sysop rights (or a sysop was not in > the 'sysopnames' var in user_config). > > Why was this functionality removed? Did it gave problems? - I would be > interested in having it back. I even remember having translated some > messages in translatewiki.net for that. > > Thank you, > -M. > > > -------------------------------- > > _______________________________________________ > Pywikipedia-l mailing list > Pywikipedia-l(a)lists.wikimedia.org > https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l >
Hi,
I run my bot in some projects where I do handle broken/double redirects repairs. IIRC in the past the redirect.py script did tagged for deletion the broken redirects if the bot didn't had sysop rights (or a sysop was not in the 'sysopnames' var in user_config).
Why was this functionality removed? Did it gave problems? - I would be interested in having it back. I even remember having translated some messages in translatewiki.net for that.
Thank you,
-M.
For all Amsterdam hackathon attendees
We've made a first draft of the programme for the Amsterdam Hackathon. We
have room for 6 workshops which will be run twice over the course of the
Hackathon.
Which topics should we cover in them? Based on your motivations, we've made
a list of the top 8 topics that seem to be of interest. Please take a look
at the page and let us know which topics you'd be most interested in:
https://www.mediawiki.org/wiki/Amsterdam_Hackathon_2013/Topics
For some of these workshops we're still looking for presenters. Are you
interested? Let us know! (hackathon(a)wikimedia.nl)
Think you could fill a 1h (interactive) workshop for one of these topics,
but you're not sure? I'll help you create a workshop and help you practice
beforehand.
Finne (henna)
On behalf of the programme committee
Hi all,
Would it ever make sense to change the whole -argumentname: command
line argument style? For instance, replace it with the standard
argument handling provided by Python[0] or (GNU) getopt[1]. As every
style change, this may just be me, but I can still list a couple of
reasons to do this:
- Standard command line arguments
- Offload the argument parsing code to tried and true libraries
Maybe in the rewrite branch?
David E. Narvaez
[0] http://docs.python.org/2/library/argparse.html
[1] http://docs.python.org/2/library/getopt.html
Hi,
Each ns:0 page on English Wiktionary is divided into a bunch of
sections headed by level-2 headers. The text of each level-2 header
is the name of a language; e.g., ==English==.
I use (something like) the following JavaScript when editing pages:
txt =
txt.replace
( /^==([a-zA-Z ]+)==\n+(?:(?:===|[^=]).*\n+)*/gm,
function(section, langname)
{ return '' +
section.replace
( /(\{\{homophones\|)([^=}]*\}\})/gm,
'$1lang={'+'{subst:langrev|'+langname+'}}|$2'
);
}
);
This searches for {{homophones|...}} without a lang= parameter and
adds the lang= parameter appropriate for the ==section== in which
{{homophones|...}} appears. This works.
I want to automate this, so wish to use pywikipediabot. So I've
translated the above into Python as best I could, and come up with the
following user-fixes.py :
def homophix(match):
return re.sub(r'(\{\{homophones\|)([^}=]*\}\})',
r'\1lang={{subst:langrev|'+re.escape(match.group(1))+r'}}|\2',
match.group(0)
)
fixes['homophones'] = {
'regex': True,
'msg': {'_default':u'add lang to homophones'},
'replacements': [
(ur'^==([a-zA-Z ]+)==\n+(?:(?:===|[^=]).*\n+)*', homophix)
]
}
...which I then tried to call using
python replace.py -fix:homophones -page:accapare
(Note that [[wikt:en:accapare]] has {{homophones|...}} without = .)
Python told me:
No changes were necessary in [[accapare]]
0 pages were changed.
So I guess it's either not matching or not replacing.
What am I doing wrong?
And what can I do instead?
Thanks,
Michael Hamm
Bináris <wikiposta(a)gmail.com>:
> Try this first in replacements:
>
> ur'(?m)^== *([a-zA-Z ]+) *==\n+ etc.
> m for multiline (sometimes ?s works instead, I just use it without
> understanding why), and space* in case there are spaces between == marks.
Sorawee Porncharoenwase <nullzero.free(a)gmail.com>:
> @Michael Hamm: Beside Bináris's suggestion, re.escape should be used only
> on pattern parameter, not replacing text; use match.group(1) instead of
> re.escape(match.group(1))
Thank you both very much. Probably (I won't be able to test it until
later today) these were the problem -- or part of it.
Michael Hamm