Happy Monday,
There are strange people who make such links (kindof urlencoded?):
[[Második világháború#Partrasz.C3.A1ll.C3.A1s Szic.C3.ADli.C3.A1ban
.28Huskey hadm.C5.B1velet.29|Huskey hadműveletben]]
So the section title must have been copied from the URL.
Do we have a ready tool to fix these?
--
Bináris
Hello all
>From one of my assignments as a bot operator I have some code which
does template parsing and general text parsing (e.g. Image/File tags).
It is not using regex and thus able to correctly parse nested
templates and other such nasty things. I have written those as library
classes and written tests for them which cover almost all of the code.
I would now really like to contribute that code back to the community.
Would you be interested in adding this code to the pywikibot
framework? If yes, can I send the code to someone for code review or
how do you usually operate?
Greetings
Hannes
PS: wiki userpage is http://en.wikipedia.org/wiki/User:Hannes_R%C3%B6st
Hi pywikibot experts,
How can I create new properties via pywikibot? (I'm trying to do it via
bot, because I'm doing some experiments on a dedicated wikibase
installation with - possibly - hundreds of properties to be created... and
Pywikibot would certainly be my favorite tool!)
In case I have, instead, to directly wrap the action "wbeditentity" from
mediawiki API (
https://www.wikidata.org/w/api.php?action=help&modules=wbeditentity ), are
there some Python examples?
And, in case I have to use the php script "importProperties.php" (
https://github.com/JeroenDeDauw/Wikibase/blob/master/repo/maintenance/impor…
),
how can I manage properties more complex than the ones contained in the
example (
https://github.com/JeroenDeDauw/Wikibase/blob/master/repo/maintenance/en-el…
)?
Using pywikibot, I'm able to MODIFY existing properties with instructions
like the following ones (which let me generate the object-content in one
shot via json ... as I need):
In [1]: import pywikibot ; site = pywikibot.Site() ; repo =
site.data_repository()
In [2]: property_page = pywikibot.PropertyPage(repo, u"P2")
In [3]: myjson = {u'descriptions': {u'en': {u'language': u'en', u'value':
u'invented description'}}, u'labels': {u'en': {u'language': u'en',
u'value': u'test property'}}}
In [4]: property_page.editEntity(myjson)
...but I cannot CREATE new properties (instantiating a PropertyPage
object), because pywikibot asks for the identifier of an existing instance:
In [11]: p_page = pywikibot.PropertyPage(repo)
---------------------------------------------------------------------------
InvalidTitle Traceback (most recent call last)
<ipython-input-11-e72b812b8cd3> in <module>()
----> 1 p_page = pywikibot.PropertyPage(repo)
/home/user/src/pywikibot_repo/pywikibot/page.pyc in __init__(self, source,
title)
4027 if not title or not self.id.startswith('P'):
4028 raise pywikibot.InvalidTitle(
-> 4029 u"'%s' is not an property page title" % title)
4030 Property.__init__(self, source, self.id)
4031
InvalidTitle: '' is not an property page title
In [12]:
In fact, as I understand, in the source code of the "WikibasePage" class, I
see that
while for the Item type, a "Special case for empty item" is mentioned (
https://github.com/wikimedia/pywikibot-core/blob/master/pywikibot/page.py#L…
)
# Special case for empty item.
if title is None or title == '-1':
super(ItemPage, self).__init__(site, u'-1', ns=ns)
assert self.id == '-1'
return
...for the Property type, instead, an empty object is NOT allowed (
https://github.com/wikimedia/pywikibot-core/blob/master/pywikibot/page.py#L…
)
if not title or not self.id.startswith('P'):
raise pywikibot.InvalidTitle(
u"'%s' is not an property page title" % title)
Property.__init__(self, source, self.id)
Thanks a lot for your attention!
The test suite is falling into disrepair.
It would be good if +2'ers can suggest changes in the last few months
which may have caused these breakages.
We need to investigate these quickly, as other bugs may be lurking
behind them, and they prevent the test suite being useful for
determining if new proposed changes will create additional
regressions.
Running the test suite on my linux workstation shows the following errors:
https://phabricator.wikimedia.org/T128987
testQueriesDirectFromClaim fails with TypeError: Cannot construct a
query from a claim of type external-id
https://phabricator.wikimedia.org/T128988
TestWiktionaryGraph.test_octagon failing
https://phabricator.wikimedia.org/T128989
TestLogeventsFactoryGenerator multi event tests failing: 500 not less
than or equal to 10
https://phabricator.wikimedia.org/T128990
WikiStats sorting algorithm causing unexpected largest wikisource
https://phabricator.wikimedia.org/T128991
test_pagegen_i18n_input failing: setlocale: LC_ALL: cannot change
locale (arz): No such file or directory
https://phabricator.wikimedia.org/T128955
script test for featured.py fails
https://phabricator.wikimedia.org/T128994
Some proofread page tests are writing to the wiki without being
declared as write tests
There are other errors occurring on travis builds, which also need
investigating, such as
https://phabricator.wikimedia.org/T128318
No handlers could be found for logger "pywiki"
Also Xqt has encountered a bug in the test suite for MS Windows
https://phabricator.wikimedia.org/T128453
script_tests fails for editarticle in windows environment
--
John Vandenberg
Found the following error in my logs:
Traceback (most recent call last):
File "/data/project/suggestbot/projects/opentask/opentask.py", line 32,
in <module>
import pywikibot
File "/shared/pywikipedia/core/pywikibot/__init__.py", line 37, in
<module>
from pywikibot import config2 as config
File "/shared/pywikipedia/core/pywikibot/config2.py", line 1090, in
<module>
userinterface_lang = getdefaultlocale()[0].split('_')[0]
AttributeError: 'NoneType' object has no attribute 'split'
opentask.py updates the English Wikipedia Community portal's list of open
tasks regularly and is run through Tool Labs grid engine. Explicitly
setting the locale in the shell script that launches it appears to not
trigger this error.
Regards,
Morten
On Fri, Mar 4, 2016 at 6:34 AM, Amate Yolande <yolandeamate(a)gmail.com> wrote:
> Hello,
>
> My name is Yolande Amate from the University of Buea Cameroon. I am
> proficient in C, C++, PHP and Python. I am new to open-source and I would
> like to participate in the Google Summer of Code 2016 / Outreachy Round 12
> with the Wikimedia Foundation.
> I am interested in working on the project "Python library for quiz data,
> with serialisation".
Welcome and good luck. I've added cc for the two main mailing lists
relevant for your project.
For anyone interested, this project is for Wikiversity & Pywikibot:
https://phabricator.wikimedia.org/T89761
As you know PHP, you may also want to look at adding GIFT support to
the Quiz extension, as that would also allow more interoperability
with other MOOC systems that support quiz functionality.
https://phabricator.wikimedia.org/T24475
--
John Vandenberg
Hello!
I am Sriharsh Bhyravajjula (irc/phab nick: *darthbhyrava*), IInd year
undergraduate student at IIIT-Hyderabad, India. I am pursuing the CLD
programme which would award me a B.Tech in Computer Science and an MS by
research in Computational Linguistics.
I am proficient in Python [1] as well as in C/C++[2], and have some basic
knowledge of CSS, JS and PHP. I have been contributing to mediawiki since
mid February, and have a couple of merged commits on phabricator already
which've helped me get familiar with the environment. I am working on more
tasks in pywikibot to get a hang of the scripts and their interactions with
each other.
I am interested in picking up a task in Pywikibot for my project proposal,
and plan on choosing one of these as my possible projects:
- Pywikibot to detect and correctly handle edits that trigger
abusefilter rules - T85656 (https://phabricator.wikimedia.org/T85656)
- Implement support for Flagged Revisions in Pywikibot - T57081 (
https://phabricator.wikimedia.org/T57081)
- Implement support for a large core MediaWiki component or extension
deployed to Wikimedia sites - T89067 (
https://phabricator.wikimedia.org/T89067)
More wishfully, I was going through the Community Wishlist results and saw
that the 'Copy and Paste detection bot' (
https://phabricator.wikimedia.org/T120435) was very popular. If there were
to be a GSoC task made out of this, and mini-tasks suggested for the same,
I would love to contribute in some way and draft a proposal around this. I
understand that mentors are short-staffed in pywikibot now. But legoktm has
suggested on IRC that if the proposal was solid enough, and provided he had
less than two projects himself, he'd step up as a mentor. :)
Any help for the above would be very welcome. :)
I plan on finishing three tasks I am currently working on by the 6th/7th of
March, and then, depending on the choice of project, finish the required
mini-tasks in another week after that, so I can have a project proposal
ready by the 16th at the latest.
@jaydb, @legoktm, @Dalda, @Billinghurst @valhallasw'cloud (and @polybuildr,
my college senior, who was selected for GSoC last year) have all been very
helpful so far, and I hope someone will step up as a mentor for the
projects I draft a proposal for, too.
Thanks and sorry for the long mail!
darthbhyrava
[1] I have built a Pacman game, an AI bot for Ultimate Tic Tac Toe,
dependency parser, a django-based portal and some generic scripts in python.
[2] I have implemented data structures, algorithms, networking scripts and
operating system code snippets in c/c++.
Hi,
I dont think we have tried running Pywikibot using a repository
without the client also installed, however I do not believe that will
be necessary.
I have added a section about Wikibase to the third-party wiki documentation
https://www.mediawiki.org/wiki/Manual:Pywikibot/Use_on_third-party_wikis#Wi…
On Wed, Mar 2, 2016 at 6:35 PM, comfortably numb
<comfortably.numb.349(a)gmail.com> wrote:
> Dear Wikibase experts,
>
> I have a (hopefully) trivial question to ask: is there any specific
> configuration to set in order to make a wikibase extension accessible via
> libraries such as Pywikibot?
> Should I maybe activate the wikibase_client ?
>
> Here's the problem described from the Pywikibot point of view: when I try to
> connect to my wikibase installation, I can access the mediawiki pages...
>
> In [1]: import pywikibot
> In [2]: site = pywikibot.Site()
> In [9]: page = pywikibot.Page(site, u"Main_Page")
> In [10]: page.get()
> Out[10]: u"<strong>MediaWiki ha ........................
>
>
> ...but I cannot access the wikibase Items (created in the same mediawiki
> installation), since the "site.data_repository()" method (of my local
> Pywikibot site-object) returns an EMPTY value...
>
> In [37]: site.data_repository()
> In [38]: type(site.data_repository())
> Out[38]: NoneType
>
>
> While, if I access (the same way) the wikibase instance of
> https://test.wikidata.org (of course) I get a correct response from the
> "site.data_repository()" method (of my local Pywikibot site-object):
>
> In [39]: wikidatatest_site = pywikibot.Site("test", "wikidata")
> In [40]: wikidatatest_site.data_repository()
> Out[40]: DataSite("test", "wikidata")
> In [41]: type(wikidatatest_site.data_repository())
> Out[41]: pywikibot.site.DataSite
>
>
> Here are the main details of my mediawiki/wikibase installation:
> - MediaWiki: 1.26.2
> - PHP: 5.6.15 (apache2handler)
> - MariaDB: 10.1.9-MariaDB
> - ICU: 4.8.1.1
> ...with these extensions (with specific versions) for Wikibase:
> - Purtle: 0.1-dev
> - Wikibase DataModel: 4.4.0
> - Wikibase DataModel JavaScript: 1.0.2-dev
> - Wikibase DataModel Serialization: 2.1.0
> - Wikibase Internal Serialization: 2.1.0
> - Wikibase JavaScript API: 1.1.0
> - Wikibase Repository: 0.5 alpha (32d7ef0) 00:03, 30 September 2015
> - Wikibase Serialization JavaScript: 2.0.6
> - Wikibase View: 0.1-dev
> - WikibaseLib: 0.5 alpha (32d7ef0) 00:03, 30 September 2015
>
> If this question is asked in the wrong context I'm really sorry (I searched
> with no success the official pages of Wikibase and the archive of this
> mailing-list, http://blog.gmane.org/gmane.org.wikimedia.wikidata.technical):
> please let me know whether I should better ask this question to the
> Pywikibot library guys.
>
> Thanks a lot for attention!
>
> _______________________________________________
> Wikidata-tech mailing list
> Wikidata-tech(a)lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
>
--
John Vandenberg