Since gerrit:131263 <https://gerrit.wikimedia.org/r/131263/> , it seems
to me that the excellent mwpfh is going to be used more and more
extensively within our framework.
Am I right? For example, the DuplicateReferences detection and fix in
reflinks.py could be brightly refactored without regular expressions.
Or are we supposed to do the opposite conversion, where possible?
I propose to create a tracking bug for all features present in
AutoWikiBrowser but not in our 'core' (e.g. gerrit:118795
Even if the user targets of the two projects are different nowadays, as
different are their tasks, I think PWB is going to be the ultimate
replacement to AWB, given its extreme extensibility and X-platformness
(actually, only a real GUI is missing).
My first experience with pywikibot, downloaded core, i wanted to change
a few pages. Immediately ran into an error when trying to set a page's
text to empty. The error message was unhelpful, but I dug through the
source and found the issue. I'd like to suggest that 2 things:
1. Setting a page's text to be empty should be allowed
2. If not, at least the error should be fixed to actually show the
correct error, explained below.
Here is an example script, and the error when running it
site = pywikibot.Site()
page = pywikibot.Page(site, "MediaWiki:Lastmodifiedat")
page.text = ""
Logging in to ianwiki:en as Ian Kelling
Traceback (most recent call last):
File "pwb.py", line 143, in <module>
run_python_file(fn, argv, argvu)
File "pwb.py", line 67, in run_python_file
exec(compile(source, filename, "exec"), main_mod.__dict__)
File "scripts/iansetup.py", line 5, in <module>
File "/a/opt/pywikibot/pywikibot/page.py", line 858, in save
File "/a/opt/pywikibot/pywikibot/page.py", line 884, in _save
raise pywikibot.PageNotSaved("%s: %s" % (link, err))
CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort
The cause is in site.py, in def editpage, line 2699:
if not text:
raise Error("editpage: no text to be saved")
This error should be shown instead of the one that is actually shown.
Hello, I have problem with script claimit.py, respective with adding
multiple values of one statement.
Typical problem is P31.
In wikidata is often
and I want to add some other. I tested various combination of -exist:ptqs,
but always there is some item to which is not added new value or added
my idea was:
P31=Q811534 <https://www.wikidata.org/w/index.php?title=Q811534> (1x)
P31= ... various trees
But script added (-exists:ptq) in every run one instance of Q811534 and one
instace of certain taxon. After few runs script says that P31 already
exists and does not add new taxons
(this item maybe should be solved in different way, but problem is not only
in this item and this property)
Is it problem in script or only incorrect combination of letters?
On 19 May 2014 22:59, Pyfisch <pyfisch(a)googlemail.com> wrote:
> Sphinx can generate really good docs from the source code and you only
> need to change source code, and then we could generate and host the docs on
> the labs server. If we require to update mediawiki.org, we wont ever
> reach sync between code and documentation. I propose to remove the
> documentation on mediawiki and only use sphinx for docs, but everywhere.
Recently, I've been thinking a lot about this, so this was a good reason to
write those thoughts down; I created a wiki page for that:
Basically, I'm not a big fan of sphinx because of the lack of accessibility
(and I *loathe* restructuredtext), and we lose e.g. translations when we
switch, so I would prefer something centered around mw.org. However, I *do*
agree it's a huge issue that code and docs are never in sync. Anyway, see
the not-yet-a-real-RFC for my thoughts.
Based on several discussions here and there I want to move
[[Manual:Pywikibot]] <https://www.mediawiki.org/wiki/PWB> (and all of the
subpages which are about 200 pages) to [[Pywikibot]] like other products
Another reason that motivates me to move is the page (and subpages) aren't
just about running a bot. they are about everything, including reports,
discussions, description about scripts and anything about pywikibot in
If you disagree or you have any ideas please feel free to share and if
there will be no objection until Tuesday, I'll move them.
As a discussion we had in Hackathon today, we concluded there is a need for
guideline for our codes (something like WP:MoS for codes)
there is already
it's not for us and we can use it though
Some things I suggest to add to the guideline in the future:
1- Don't use commented out codes
2- use "bot" instead of "robot" in naming and documentation
3- Don't use \t (tab character) in codes
What do you think about this? if you agree I'll start
I just want to mention a discussion about lowercase_with_underscores and mixedCase: https://gerrit.wikimedia.org/r/#/c/105173/ I agree that it should be consistent and everything changed to a single standard, I would prefer lowercase_with_underscores.