https://bugzilla.wikimedia.org/show_bug.cgi?id=56901
Web browser: --- Bug ID: 56901 Summary: Port unusedfiles.py to Pywikibot core Product: Pywikibot Version: unspecified Hardware: All OS: All Status: NEW Keywords: easy Severity: normal Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: crangasi2001@yahoo.com CC: aklapper@wikimedia.org, ladsgroup@gmail.com, qgil@wikimedia.org Blocks: 55880 Classification: Unclassified Mobile Platform: ---
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 unusedfiles.py, 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 MediaWiki.org account). More documentation on gerrit can be found at [5].
[1] https://www.mediawiki.org/wiki/Manual:Pywikibot [2] https://www.mediawiki.org/wiki/Manual:Pywikibot/2.0/Conversion [3] https://www.mediawiki.org/wiki/Manual:Pywikibot/i18n_conversion [4] https://tools.wmflabs.org/gerrit-patch-uploader/ [5] http://www.mediawiki.org/wiki/Manual:Pywikipediabot/Gerrit
https://bugzilla.wikimedia.org/show_bug.cgi?id=56901
Strainu crangasi2001@yahoo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Whiteboard| |gci2013 | |https://www.mediawiki.org/w | |iki/Google_Code-In#Candidat | |e_tasks
https://bugzilla.wikimedia.org/show_bug.cgi?id=56901
Richard L lettrich42@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |lettrich42@gmail.com
--- Comment #1 from Richard L lettrich42@gmail.com --- I am a Google Code In Student who has accepted this Bug to conver unusedfiles.py from compat to core(https://google-melange.appspot.com/gci/task/view/google/gci2013/579913195192...). Should I upload it to the original repository of pywikibot/compat, or to the pywikibot/core repository where it is ported to?
https://bugzilla.wikimedia.org/show_bug.cgi?id=56901
--- Comment #2 from Strainu crangasi2001@yahoo.com --- The file needs to get in pywikibot/core, so you need to generate a patch for that project.
https://bugzilla.wikimedia.org/show_bug.cgi?id=56901
--- Comment #3 from Richard L lettrich42@gmail.com --- 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 user.name [[mw:User:Richardusername]] git config user.email gerritpatchuploader@gmail.com 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?
https://bugzilla.wikimedia.org/show_bug.cgi?id=56901
--- Comment #4 from Strainu crangasi2001@yahoo.com --- 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 unusedfiles.py - git commit (make sure you write a good commit description) - git format-patch -1 HEAD
See http://stackoverflow.com/questions/6658313/generate-a-git-patch-for-a-specif... for details.
The git format-patch command will generate a patch file that you can then upload to gerrit.
https://bugzilla.wikimedia.org/show_bug.cgi?id=56901
--- Comment #5 from Richard L lettrich42@gmail.com --- https://gerrit.wikimedia.org/r/#/c/97016/
https://bugzilla.wikimedia.org/show_bug.cgi?id=56901
--- Comment #6 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 97016 had a related patch set uploaded by Richardll: Ported unusedfiles.py from pywikibot compat to core
https://gerrit.wikimedia.org/r/97016
https://bugzilla.wikimedia.org/show_bug.cgi?id=56901
Gerrit Notification Bot gerritadmin@wikimedia.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |PATCH_TO_REVIEW
https://bugzilla.wikimedia.org/show_bug.cgi?id=56901
--- Comment #7 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 97016 merged by Strainu: Ported unusedfiles.py to pywikibot/core, added unicode support.
https://gerrit.wikimedia.org/r/97016
https://bugzilla.wikimedia.org/show_bug.cgi?id=56901
Merlijn van Deen valhallasw@arctus.nl changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|PATCH_TO_REVIEW |RESOLVED Resolution|--- |FIXED
pywikipedia-bugs@lists.wikimedia.org