Drop code for the old wiki

This commit is contained in:
Jochen Sprickerhof 2021-11-16 14:28:38 +01:00
parent 6952a23c47
commit b6f1f4231a
9 changed files with 3 additions and 409 deletions

View file

@ -563,38 +563,6 @@ def status_update_json(processed, failed):
common.write_status_json(output)
def update_wiki(gplaylog, locallog):
if config.get('wiki_server') and config.get('wiki_path'):
try:
import mwclient
site = mwclient.Site((config['wiki_protocol'], config['wiki_server']),
path=config['wiki_path'])
site.login(config['wiki_user'], config['wiki_password'])
# Write a page with the last build log for this version code
wiki_page_path = 'checkupdates_' + time.strftime('%s', start_timestamp)
newpage = site.Pages[wiki_page_path]
txt = ''
txt += "* command line: <code>" + ' '.join(sys.argv) + "</code>\n"
txt += common.get_git_describe_link()
txt += "* started at " + common.get_wiki_timestamp(start_timestamp) + '\n'
txt += "* completed at " + common.get_wiki_timestamp() + '\n'
txt += "\n\n"
txt += common.get_android_tools_version_log()
txt += "\n\n"
if gplaylog:
txt += '== --gplay check ==\n\n'
txt += gplaylog
if locallog:
txt += '== local source check ==\n\n'
txt += locallog
newpage.save(txt, summary='Run log')
newpage = site.Pages['checkupdates']
newpage.save('#REDIRECT [[' + wiki_page_path + ']]', summary='Update redirect')
except Exception as e:
logging.error(_('Error while attempting to publish log: %s') % e)
config = None
options = None
start_timestamp = time.gmtime()
@ -635,10 +603,8 @@ def main():
apps = common.read_app_args(options.appid, allapps, False)
gplaylog = ''
if options.gplay:
for appid, app in apps.items():
gplaylog += '* ' + appid + '\n'
version, reason = check_gplay(app)
if version is None:
if reason == '404':
@ -660,10 +626,8 @@ def main():
else:
logging.info("{0} has the same version {1} on the Play Store"
.format(_getappname(app), version))
update_wiki(gplaylog, None)
return
locallog = ''
processed = []
failed = dict()
exit_code = 0
@ -675,7 +639,6 @@ def main():
msg = _("Processing {appid}").format(appid=appid)
logging.info(msg)
locallog += '* ' + msg + '\n'
try:
checkupdates_app(app)
@ -684,11 +647,9 @@ def main():
msg = _("...checkupdate failed for {appid} : {error}").format(appid=appid, error=e)
logging.error(msg)
logging.debug(traceback.format_exc())
locallog += msg + '\n'
failed[appid] = str(e)
exit_code = 1
update_wiki(None, locallog)
status_update_json(processed, failed)
sys.exit(exit_code)