Skip to content

Commit 9bac35d

Browse files
authored
Merge pull request #34 from wikimedia/2022-update
Fix Python 3.8 deprecations, update README
2 parents dfbb7ae + 9609cbe commit 9bac35d

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ This project allows the [Community Tech bot](https://en.wikipedia.org/wiki/User:
1616
* Page count by namespace
1717
* Most edited articles last month
1818
* PRODed articles with deletion logs
19-
* Editors eligible for autopatrol privileges
2019
* Active editors with the longest-established accounts
2120

2221
## Installation
@@ -29,10 +28,17 @@ Virtualenv is recommended:
2928
After installation, either activate virtualenv like above or use `venv/bin/python` to run scripts.
3029

3130
## Generating a report
32-
* Log into the Toolforge bastion using your Wikimedia developer account ```ssh username@login.tools.wmflabs.org```
33-
* Become your tool account ```become database-reports```
34-
* Run ```python3 main.py test articles_by_size```. It takes two arguments; in this example test refers to `test.wikipedia.org` and `articles_by_size` is the type of statistics you're requesting. This command outputs the name of the page on which the report got dumped
35-
* To alter the default settings for periodic updates, make changes to the crontab file ```crontab -e```
31+
32+
Run ```python3 main.py test orphaned_talk```. It takes two arguments; in this example test refers to
33+
`test.wikipedia.org` and `orphaned_talk` is the type of statistics you're requesting. This command outputs
34+
the name of the page on which the report got dumped.
35+
36+
You can pass the ```--dry-run``` flag to print output to stdout rather than editing the wiki.
37+
38+
On Toolforge, the reports are defined in the ```jobs.yaml``` file.
39+
See the [Toolforge jobs framework documentation](https://wikitech.wikimedia.org/wiki/Help:Toolforge/Jobs_framework) for more information.
40+
41+
If you need to run a one-off job on Toolforge, find the corresponding command in ```jobs.yaml``` and [schedule it](https://wikitech.wikimedia.org/wiki/Help:Toolforge/Jobs_framework#Creating_one-off_jobs) using ```toolforge-jobs```.
3642

3743
## Adding support for a report
3844
* To add support for a specific statistics that you would like to see in a report, declare a function in `main.py` and define it in `reports.py`
@@ -42,4 +48,4 @@ After installation, either activate virtualenv like above or use `venv/bin/pytho
4248
Bug reports, fixes, and new features are welcomed. If you'd like to contribute code please:
4349
* Fork the project
4450
* Start a branch named for your new feature or bug
45-
* Create a pull request
51+
* Create a pull request

reports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ def linkify( self, title, namespace = None ):
456456
title_clean = title.replace( '_', ' ' )
457457
if namespace is None:
458458
return '[[' + title_clean + ']]'
459-
elif namespace is 6:
459+
elif namespace == 6:
460460
return '[[:{{subst:ns:%s}}:%s]]' % ( namespace, title_clean )
461461
else:
462462
return '[[{{subst:ns:%s}}:%s]]' % ( namespace, title_clean )

0 commit comments

Comments
 (0)