Page MenuHomePhabricator

Port to Pywikibot core
Closed, ResolvedPublic


PyWikibot [1] is a Python-based framework to write bots for MediaWiki. There are currently 2 versions of pywikibot currently used:

  • version 1.0 (also known as pywikibot-compat) is the legacy version
  • version 2.0 (also known as pywikibot-core) is a rewrite of the original framework, focusing solely on MediaWiki wikis with an API (version 1.14 or newer) and offering an improved internal architecture.

There are a number of scripts used by various robot operators that were used in pywikibot-compat but have not yet been adapted to work with pywikibot-core. One of those is, which Finds unused media using [[Special:Unusedimages]].

You can find information about how to convert the script on [2], [3]. Patches can be submited through the gerrit uploader [4] (you need a account). More documentation on gerrit can be found at [5].


Version: unspecified
Severity: normal
Whiteboard: gci2013



Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:28 AM
bzimport set Reference to bz56901.
bzimport added a subscriber: Unknown Object (????).

lettrich42 wrote:

I am a Google Code In Student who has accepted this Bug to conver from compat to core( Should I upload it to the original repository of pywikibot/compat, or to the pywikibot/core repository where it is ported to?

The file needs to get in pywikibot/core, so you need to generate a patch for that project.

lettrich42 wrote:

Thanks fore the response. Sorry, but i seem to have another problem, and I got the dump from the Gerrit uploader:

Result from uploading patch:
git clone --depth=1 ssh://gerrit/pywikibot/core /tmp/1609560.1.webgrid/tmp5VqLtG Cloning into '/tmp/1609560.1.webgrid/tmp5VqLtG'... Total 254 (delta 84), reused 94 (delta 52) git rev-parse --abbrev-ref HEAD Will commit to branch: master git config [[mw:User:Richardusername]] git config scp -p gerrit:hooks/commit-msg .git/hooks/ git apply < patch fatal: unrecognized input patch -p0 < patch patch: ** Only garbage was found in the patch input. patch -p1 < patch patch: ** Only garbage was found in the patch input.
Upload failed
Reason: Patch failed (is your patch in unified diff format, and does it patch apply cleanly to master?) (check log above for details)

I read about using git diff in the Gerrit tutorial, should I use it instead?

How did you generate your patch? Normally, the procedure I suggest is the following:

  • clone the pywikibot/core branch
  • add the file, make the modifications etc.
  • git add
  • git commit (make sure you write a good commit description)
  • git format-patch -1 HEAD

See for details.

The git format-patch command will generate a patch file that you can then upload to gerrit.

Change 97016 had a related patch set uploaded by Richardll:
Ported from pywikibot compat to core

Change 97016 merged by Strainu:
Ported to pywikibot/core, added unicode support.