Hi all,
I'm building a small pywikibot tool[1] which is designed to be installed
via pip (and in turn installs Pywikibot via pip).
The tool uses the page.touch() function which is where I get a
pywikibot.i18n.TranslationError when I run it.
page.touch() gets it's edit summary from i18n.twtranslate(self.site,
'pywikibot-touch') which in turn is defined in /scripts/i18n/pywikibot/.
Unless I'm confused the Error occurs because the pip distribution does not
include the /scripts folder or the i18n submodule.
So my first question is am I just doing something obviously wrong and the
i18n submodule should have been available over pip as well?
If it's not just me then would it not make sense to have any i18n files
necessary to the Pywikibot *library* to also be distributed via the same
pip package? (i18n for scripts is another issue since for scripts you
cannot use pip).
Cheers,
André / Lokal_Profil
[1] https://github.com/lokal-profil/pywikibot-sdc
André Costa | Chief Operating Officer, Wikimedia Sverige |
Andre.Costa(a)wikimedia.se | +46 (0)733-964574
Stöd fri kunskap, bli medlem i Wikimedia Sverige.
Läs mer på blimedlem.wikimedia.se
------
sent from my mobile, all typos are due to autocorrect ;)
Hi lovely pywikibot folks. I'd like to clean up our deprecated code
since we have some that's six years old....
% grep -RIoh "since='[^']\+'" ./* | sort | head -n 5
since='20150206'
since='20150515'
since='20150615'
since='20150617'
since='20150619'
% grep -RIoh "since='[^']\+'" ./* | wc -l
130
What is pywikibot's policy regarding code deprecation? Can we remove
it after a set duration and, if so, what is it?
Thanks! -Damian
Hi lovely Pywikibot folks. I'm the author of tor's python library [1]
and recently decided to see what it's like to volunteer for this
community instead.
I have a few newcomer questions...
1. This email list and #pywikibot are remarkably quiet (~2/month as
compared with the 'handful a week' described by the wiki [2]). Does
pywikibot have any other communication channels (say, to request a
bot) with more activity?
2. I created a bot account with a BotPassword to give our readme's
example a whirl but Wikipedia evidently blocks bot access to its
sandbox page?
% cat demo.py
import pywikibot
site = pywikibot.Site('en', 'wikipedia') # The site we want to run our bot on
page = pywikibot.Page(site, 'Wikipedia:Sandbox')
page.text = 'hello world'
page.save('pywikibot practice') # Saves the page
% python pwb.py demo.py
Traceback (most recent call last):
File "pwb.py", line 363, in <module>
if not main():
File "pwb.py", line 355, in main
run_python_file(filename,
File "pwb.py", line 74, in run_python_file
exec(compile(source, filename, 'exec', dont_inherit=True),
File "./demo.py", line 5, in <module>
page.save('pywikibot practice') # Saves the page
File "/home/atagar/Desktop/pywikibot/core/pywikibot/tools/__init__.py",
line 1452, in wrapper
return obj(*__args, **__kw)
File "/home/atagar/Desktop/pywikibot/core/pywikibot/tools/__init__.py",
line 1452, in wrapper
return obj(*__args, **__kw)
File "/home/atagar/Desktop/pywikibot/core/pywikibot/page/__init__.py",
line 1168, in save
raise pywikibot.OtherPageSaveError(
pywikibot.exceptions.OtherPageSaveError: Edit to page
[[Wikipedia:Sandbox]] failed:
Editing restricted by {{bots}}, {{nobots}} or site's equivalent of
{{in use}} template
CRITICAL: Exiting due to uncaught exception <class
'pywikibot.exceptions.OtherPageSaveError'>
Am I reading this error correctly? If so, maybe I could change our
readme to something that works out of the box? If that would be ok,
any tip on what it should demonstrate?
3. How do I run pywikibot's tests? I'd like to note the command on
our development wiki [3].
Thanks! -Damian
[1] https://stem.torproject.org/
[2] https://www.mediawiki.org/wiki/Manual:Pywikibot/Communication#pywikibot
[3] https://www.mediawiki.org/wiki/Manual:Pywikibot/Development