Hi there !,
Is in the rewrite branch a way of getting the wiki-text of a diff like using
this link
http://es.wikipedia.org/w/index.php?diff=37372500&oldid=32780367&diffonly=1?.
I think it can be donned via the API with "prop=revisions" and a
combination of parameters specially "rvdiffto". "Site" class has a
"loadrevisions" method but has no "rvdiffto" implementation. Is there any
other way to get just the diff from two versions?.
Thanks !!
Matias.
Hello,
In pywikipedia there was a botflag parameter in page.put() that allowed
a bot to make an edit without the botflag set. It looks like this
parameter is not present in the pywikibot framework. Could the parameter
be added there? Or maybe is there another method to achieve this?
Thanks,
N.
In rewrite's branch, the 'site' attribute of Link() objects is set to a
property attribute, and thus accessible through Link.site, while for
Page() objects it is a method and thus you get the site via Page.site().
This is quite inconsistent and, although not insuperable, adds some
pitfalls when using the framework (eg when porting 'old' scripts, as
some methods that used to yield Page() objects now yield Link() ones).
Is there a possibility to homogenize this and help poor little coders
like me ? :)
My favorite would be to use @property on both, but it's one more step
against backward compatibility.
Thanks,
stan.
PS: I can work on a patch for this upon request, if needed.
Hello,
I was wondering about the python requirements for pywikibot.
I tried to run a script on the toolserver (nightshade and wolsbane) and
from the error messages I get there I understand that it requires python
2.6 (won't work with 2.5) and (at least) httplib2. Is this correct?
Thanks,
N.
Im looking to possibly start using the re-write branch but what do I need to
be aware of during the conversion. I would rather not re-write all my code.
John
Hi!
I recently started using my bot again (after some time), and was delighted
to discover that featured.py now places the {{Link FA|xx}} templates next to
the interwiki link to that language instead of above all the interwikis
(AFAIR that was not the case a few years ago). However, interwiki.py does
not cooperate with this, and when it finds a {{Link FA|xx}} template in the
interwiki section of a page, it moves it to above the interwikis. This, as
you understand, voids the improved behaviour of featured.py. For example,
see [1] vs [2].
Unfortunately I don't know enough python to fix this myself, but I would
like to suggest that (1) interwiki.py, when it finds them, places the {{Link
FA|xx}} templates next to the [[xx:Yyy]] links, like featured.py does, and
that (2) featured.py places all {{Link FA|xx}} templates it finds next to
their respective [[xx:Yyy]] links, and not just the one it is currently
working on. (As you can see from [2] there are previous {{Link FA}}
templates there as well, and the result after a few rounds of featured.py
and then interwiki.py can be a bit messy, see [3].) It would also be good if
featured.py would change the English names of the templates to the localized
versions where they exist (e.g. Link FA -> Link UA and Link GA -> Link AA
for Norwegian).
I hope these requests aren't too difficult to fix; as I know very littel
python I don't really know what it would take to fix them, unfortunately.
[1]
http://no.wikipedia.org/w/index.php?title=Indonesia&action=historysubmit&di…
[2]
http://no.wikipedia.org/w/index.php?title=Indonesia&action=historysubmit&di…
[3]
http://no.wikipedia.org/w/index.php?title=Indonesia&oldid=7149308&action=ed…
--
Jon Harald Søby
http://meta.wikimedia.org/wiki/User:Jon_Harald_S%C3%B8by
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
As discussed long ago, the English documentation about this bot
framework has been moved to the English Wikibooks. Contributors of other
languages may with to move those language versions to the other
languages of Wikibooks.
You can now find the imported and mostly-cleaned-up textbook at
http://en.wikibooks.org/wiki/Pywikibot
Thanks,
- -Mike
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iEYEARECAAYFAkv3SVcACgkQst0AR/DaKHvQIwCfX8ifMdXvMVHrVszo2UgC0Knx
exQAnRUuhbqk/Ic6Nqxrd2fJim1abHE0
=gcZc
-----END PGP SIGNATURE-----
Hi,
I'm currently working on porting welcome.py to the rewrite branch, and I
have a little question regarding the translate() function, which is
quite heavily used by lots of scripts :
In 'trunk', this function has some sort of hackish/dirty/magical way to
determine if the dict passed to it is of the form
{'family':'lang':'translation'} or simply {'lang':'translation'}, a
feature(?) that is missing in the rewrite implementation.
So, the question is, is this something that has been intentionally
dropped and should be managed by the bot itself, or does it fit in the
not_yet_implemented basket ?
Thanks,
stanlekub.
This e-mail was sent by Maarten to the pywikipedia-svn mailing list.
---------- Forwarded message ----------
From: Maarten Dammers <maarten(a)mdammers.nl>
To: pywikipedia-svn(a)lists.wikimedia.org
Date: Mon, 03 May 2010 23:15:47 +0200
Subject: Re: [Pywikipedia-svn] SVN: [8136] trunk/pywikipedia/wikipedia.py
This change is incorrect. Categories() should return Page objects, not
Unicode objects. Could you please fix this?
Maarten
Op 28-4-2010 22:29, shizhao(a)svn.wikimedia.org schreef:
> Revision: 8136
> Author: shizhao
> Date: 2010-04-28 20:29:31 +0000 (Wed, 28 Apr 2010)
>
> Log Message:
> -----------
> categories() new add API query.
>
> Modified Paths:
> --------------
> trunk/pywikipedia/wikipedia.py
>
> Modified: trunk/pywikipedia/wikipedia.py
> ===================================================================
> --- trunk/pywikipedia/wikipedia.py 2010-04-28 14:33:06 UTC (rev 8135)
> +++ trunk/pywikipedia/wikipedia.py 2010-04-28 20:29:31 UTC (rev 8136)
> @@ -2173,12 +2173,50 @@
> category links in the page text.
>
> """
> - try:
> - category_links_to_return =
> getCategoryLinks(self.get(get_redirect=get_redirect), self.site())
> - except NoPage:
> - category_links_to_return = []
> - return category_links_to_return
> +# New add API query.
>
> +# api.php?action=query&prop=categories&titles=Albert%20Einstein
> +
> +#
> + if not self.site().has_api():
> + try:
> + category_links_to_return =
> getCategoryLinks(self.get(get_redirect=get_redirect), self.site())
> + except NoPage:
> + category_links_to_return = []
> + return category_links_to_return
> +
> + params = {
> + 'action': 'query',
> + 'prop' : 'categories',
> + 'titles' : self.title(),
> + }
> + if not self.site().isAllowed('apihighlimits') and
> config.special_page_limit> 500:
> + params['cllimit'] = 500
> +
> +
> + allDone = False
> + cats=[]
> + while not allDone:
> + output(u'Getting categories in %s via API...' % self.aslink())
> +
> + datas = query.GetData(params, self.site())
> + data=datas['query']['pages'].values()[0]
> + if "categories" in data:
> + for c in data['categories']:
> + cats.append(c['title'])
> +# if len(data) == 2:
> +# data = data[0] + data[1]
> +# else:
> +# data = data[0]
> +
> + if 'query-continue' in datas:
> + if 'categories' in datas['query-continue']:
> + params['clcontinue'] =
> datas['query-continue']['categories']['clcontinue']
> +
> + else:
> + allDone = True
> + return cats
> +
> def __cmp__(self, other):
> """Test for equality and inequality of Page objects"""
> if not isinstance(other, Page):
>
>
>
> _______________________________________________
> Pywikipedia-svn mailing list
> Pywikipedia-svn(a)lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/pywikipedia-svn
>
>
---------- Forwarded message ----------
From: pywikipedia-svn-request(a)lists.wikimedia.org
To:
Date:
Subject: confirm 5757ba7a08bb8766eda2b6838461d7dd08516048
If you reply to this message, keeping the Subject: header intact,
Mailman will discard the held message. Do this if the message is
spam. If you reply to this message and include an Approved: header
with the list password in it, the message will be approved for posting
to the list. The Approved: header can also appear in the first line
of the body of the reply.