On Fri, Oct 3, 2014 at 1:29 PM, Manpreet Kaur
<manpreetkaur9411(a)gmail.com> wrote:
Hi! I am new to pywikibot and have been going through
installation/contribution articles. I have two questions:
1. What is the difference b/w pywikibot-core/compat and core/compat? Do i
need to install both?
Repeating what Amir and Fabian have said...
It is a good idea to clone both the compat and core repos.
http://git.wikimedia.org/summary/pywikibot%2Fcore.git
http://git.wikimedia.org/summary/pywikibot%2Fcompat.git
Also be aware that pywikibot-core has a subdirectory
'pywikibot/compat', which is a part of pywikibot-core intended to
assist old pywikipedia (i.e. 1.0) scripts to run on pywikibot (i.e.
2.0).
http://git.wikimedia.org/tree/pywikibot%2Fcore.git/master/pywikibot%2Fcompat
2. I wish to fix the bug 57995 - Add function for
list=watchlistraw. On the
gerrit
page(https://gerrit.wikimedia.org/r/#/c/100363/). A couple of patches
have been uploaded but I cant view the given links. Also, I am assuming that
I need to continue where others left but how do I know what parts of the
bugs have been fixed?
Gerrit 100363 added a _script_ called 'watchlist.py'.
http://git.wikimedia.org/blob/pywikibot%2Fcore.git/master/scripts%2Fwatchli…
Firstly, it has one major problem: it uses an uncached API call (line
89-90) and performs its own caching (line 102-7). As the watchlist
can be very large, constantly refetching the watchlist from the server
is not a good idea.
In pywikipedia (v1.0), the software was built with lots of scripts
(like watchlist.py) providing critical tasks, and each script was
written a different way. Therefore caching of data in watchlist.py is
using its own strategy. In pywikibot (2.0), CachedRequest was added,
so all MediaWIki API responses may be cached in a uniform manner.
http://git.wikimedia.org/blob/pywikibot%2Fcore.git/master/pywikibot%2Fdata%…
So we have bug 68988: "watchlist.py should use CachedRequest"
https://bugzilla.wikimedia.org/show_bug.cgi?id=68988
Using CachedRequest instead of Request only requires the addition of
an expiry parameter, so that part should be very simple.
A more significant improvement is that the watchlist functionality
should be part of the library , i.e. part of the APISite class, which
is in pywikibot/site.py . That is what bug 57995 has requested. That
involves moving some of the code from scripts/watchlist.py to
pywikibot/site.py, and rewriting it to be consistent with other
APISite methods.
For bonus points, the cached watchlist data should be invalidated when
a new page is added to the watchlist via Page.save / Page.watch. See
als APISite.editpage
A really difficult improvement, which may not be desirable in many
cases (e.g. small watchlists), and may not be worth the overhead &
support costs: instead of invalidating the cached watchlist data,
pywikibot could update the cached list of watchlisted pages on the
client site.
I recommend that you join the IRC channel (
http://webchat.freenode.net/?channels=#pywikibot ) to chat with other
devs, who can help you get started, and discuss design decisions with
you.
--
John Vandenberg