-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsd_run.py
34 lines (30 loc) · 1.28 KB
/
sd_run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Code for ShortDescBot, task 2 - organisms
#
# Michael Maggs, released under GPL v3
# Developed from original code by Mike Peel, GPL v3, 28 November 2020:
# https://bitbucket.org/mikepeel/wikicode/src/master/shortdesc_run.py and
# https://bitbucket.org/mikepeel/wikicode/src/master/shortdesc_functions.py
# 2020–21. Latest update 27 February 2021
from sd_add import *
from sd_stage import *
# Initialise the site
wikipedia = pywikibot.Site('en', 'wikipedia')
username = pywikibot.config.usernames['wikipedia']['en']
# Run staging code
if mode_flag == 'stage':
print('\nLogged in as ' + username)
if write_wp_examples:
print(f'Will write up to {max_examples} examples to my Wikipedia userspace\n')
if use_basefile:
input(f'***** Ready to stage from {base_file}. Press return to continue\n')
else:
input(f'***** Ready to stage from {targetcat}. Press return to continue\n')
shortdesc_stage()
# Run live editing code
if mode_flag == 'edit':
print('\nLogged in as ' + username)
run_type = 'assisted' if assisted_mode else 'automatic'
if override_manual or override_embedded:
print('WARNING: the bot may change existing descriptions')
input(f'***** READY TO WRITE LIVE EDITS in {run_type} mode. Press return to continue\n')
shortdesc_add()