diff --git a/category-cycles/get_edges.sql b/category-cycles/get_edges.sql index 0c05d6d..0eff91b 100644 --- a/category-cycles/get_edges.sql +++ b/category-cycles/get_edges.sql @@ -1,4 +1,4 @@ select cl_from as subcat, page_id as parentcat from categorylinks join page on page_namespace = 14 and page_title = cl_to -where cl_type = 'subcat'; \ No newline at end of file +where cl_type = 'subcat'; diff --git a/feature-historian.ts b/feature-historian.ts index 1ea6bbd..62bf189 100644 --- a/feature-historian.ts +++ b/feature-historian.ts @@ -51,8 +51,8 @@ for await (let pg of reader) { let faXActionParams = template.parameters.filter(p => /^fa[cr]/i.test(p.value.trim())); let nums = faXActionParams.map(p => { let numMatch = String(p.name).match(/\d+$/); - return numMatch && numMatch[0]; - }).filter(e => e).sort(); + return numMatch && parseInt(numMatch[0]); + }).filter(e => e).sort((a, b) => a < b ? -1 : 1); if (nums.length === 0) { noFaXParams.push(pg.title.slice('Talk:'.length)); diff --git a/g13-watch/save-to-db.js b/g13-watch/save-to-db.js index 0c08723..e374865 100644 --- a/g13-watch/save-to-db.js +++ b/g13-watch/save-to-db.js @@ -11,7 +11,7 @@ function logError(err) { function logWarning(evt) { try { const stringified = JSON.stringify(evt, null, 2); - botbase_1.fs.appendFileSync('./warnlog.txt', `\n[${new botbase_1.bot.date().format('YYYY-MM-DD HH:mm:ss')}: ${stringified}`); + botbase_1.fs.appendFileSync('./warnlog.txt', `\n[${new botbase_1.bot.date().format('YYYY-MM-DD HH:mm:ss')}]: ${stringified}`); } catch (e) { // JSON.stringify fails on circular object logError(e); @@ -114,4 +114,3 @@ async function go() { }); } go(); -//# sourceMappingURL=save-to-db.js.map \ No newline at end of file diff --git a/g13-watch/save-to-db.ts b/g13-watch/save-to-db.ts index 742d123..5dd6e11 100644 --- a/g13-watch/save-to-db.ts +++ b/g13-watch/save-to-db.ts @@ -12,7 +12,7 @@ function logError(err) { function logWarning(evt) { try{ const stringified = JSON.stringify(evt, null, 2); - fs.appendFileSync('./warnlog.txt', `\n[${new bot.date().format('YYYY-MM-DD HH:mm:ss')}: ${stringified}`); + fs.appendFileSync('./warnlog.txt', `\n[${new bot.date().format('YYYY-MM-DD HH:mm:ss')}]: ${stringified}`); } catch(e) { // JSON.stringify fails on circular object logError(e); } diff --git a/run-job.py b/run-job.py index 9c9f9d5..d1c1f0c 100644 --- a/run-job.py +++ b/run-job.py @@ -1,23 +1,23 @@ -#!/usr/bin/python3 - -import sys -import os - -try: - runjob = sys.argv[1].lower() -except IndexError: - print('USAGE: python run-task.py ') - sys.exit(1) - -with open('/data/project/sdzerobot/SDZeroBot/crontab', 'r') as crontab: - lines = crontab.read().splitlines() - lines = [line for line in lines if not line.startswith('#') and line.strip() is not ''] - for line in lines: - job = line.split()[8].lower() - if job[4:] == runjob: - command = ' '.join(line.split()[5:]) - print('> ' + command) - os.popen(command) - break - else: - print('no matching cron job') +#!/usr/bin/python3 + +import sys +import os + +try: + runjob = sys.argv[1].lower() +except IndexError: + print('USAGE: python run-task.py ') + sys.exit(1) + +with open('/data/project/sdzerobot/SDZeroBot/crontab', 'r') as crontab: + lines = crontab.read().splitlines() + lines = [line for line in lines if not line.startswith('#') and line.strip() is not ''] + for line in lines: + job = line.split()[8].lower() + if job[4:] == runjob: + command = ' '.join(line.split()[5:]) + print('> ' + command) + os.popen(command) + break + else: + print('no matching cron job')