MediaWiki Bot Framework for Galician Projects¶
Framework on top of Pywikibot to operate on MediaWiki sites in Galician.
The framework includes a script to update the population data on articles about locations within Galicia.
Usage¶
To run any script of the framework, you must install the framework as follows:
Download the source code.
Install Python 3.
Install on a Python 3 virtual environment:
For example, on Linux:
python3 -m venv venv . venv/bin/activate pip install -e .
Note
On Windows, you may optionally install
colorama
to enjoy colors on the command-line interface:pip install colorama
Create a
user-config.py
file with the following content:family = 'wikipedia' mylang = 'gl' usernames['wikipedia']['*'] = '<Your Galician Wikipedia Username>' password_file = 'user-password.py'
Create a
user-password.py
file as described in the PyWikiBot documentation.Do not prefix strings with
u
(e.g.u'asdf'
) as described in the documentation. That is for Python 2. In Python 3 you should remove it (e.g.'asdf'
).Run any script. For example:
pywikibotgl-population
Once these initial steps are done, to run a script again after you close the current terminal you must always first re-enable the virtual environment:
. venv/bin/activate
Development¶
Automated Tests¶
To run the automated tests:
python3 -m venv venv
. venv/bin/activate
pip install -e .
pip install pytest pytest-pylint
pytest --pylint
Internationalization and Localization¶
To update the translation templates:
bash utils/update-pot.sh
To update the translation files:
bash utils/update-po.sh
\ Sort by:\ best rated\ newest\ oldest\
\\
Add a comment\ (markup):
\``code``
, \ code blocks:::
and an indented block after blank line