DrTrigon has submitted this change and it was merged.
Change subject: bugfix; several minor fixes for * pep8 * migration from ts to
labs
......................................................................
bugfix; several minor fixes for
* pep8
* migration from ts to labs
Change-Id: I766b4ef92fb36b6ba755481117e62be61bfba58b
---
M crontab
M fabfile.py
M public_html/cgi-bin/panel.py
3 files changed, 8 insertions(+), 4 deletions(-)
Approvals:
DrTrigon: Verified; Looks good to me, approved
diff --git a/crontab b/crontab
index e9c4b77..2410bbc 100644
--- a/crontab
+++ b/crontab
@@ -108,5 +108,5 @@
#06 * * * * jsub -l h_vmem=512M -quiet -N subster_ar python
$HOME/pywikibot-compat/pwb.py -subster -lang:ar
#06 3 * * * jsub -l h_vmem=512M -quiet -N subster_data python
$HOME/pywikibot-compat/pwb.py -subster -family:wikidata -lang:wikidata
-# maintenance: archive_logs
+# maintenance: archive_logs
06 23 1 * * jsub -l h_vmem=256M -quiet -N maint_archive fab -f
$HOME/fabfile.py -H localhost archive_logs
diff --git a/fabfile.py b/fabfile.py
index 0de5b1e..59ae476 100644
--- a/fabfile.py
+++ b/fabfile.py
@@ -380,7 +380,7 @@
#tar zcvf /backups/trunk-$fecha.tgz /var/www/repository
local('tar zcvfh ~/public_html/logs/archive/logs-%s.tgz ~/public_html/logs
--exclude=public_html/logs/archive' % fecha)
# Rotate the logs, delete older than 7 days
- #find /backups/ -mtime +7 -exec rm {} \;
+ #find /backups/ -mtime +7 -exec rm {} \;
local('find ~/public_html/logs/archive/ -mtime +200 -exec rm {} \;')
local('find -L ~/public_html/logs/*/*.log.* -mtime +40 -exec rm {} \;')
diff --git a/public_html/cgi-bin/panel.py b/public_html/cgi-bin/panel.py
index 606e8bf..de2b6bb 100755
--- a/public_html/cgi-bin/panel.py
+++ b/public_html/cgi-bin/panel.py
@@ -140,6 +140,10 @@
ver_desc = style.ver_desc[style.host(os.environ)]
localdir = style.localdir[style.host(os.environ)]
+links = {'log': { 'ts': localdir,
+ 'labs': '../logs'},
+ 'old': { 'ts': r"../DrTrigonBot/",
+ 'labs': r"../logs/"},}
# === bot status surveillance === === ===
@@ -534,7 +538,7 @@
data['botlog'] = stat['lastmessage']
data['messages'] = "\n".join(stat['messages'])
data['successfull'] = "%s of %s" % (stat['ecount']['end'],
stat['ecount']['start'])
- data['loglink'] = '<a href="%s">Latest</a>' %
os.path.join(localdir, recent)
+ data['loglink'] = '<a href="%s">Latest</a>' %
os.path.join(links['log'][style.host(os.environ)], recent)
lastrun = max([os.stat(os.path.join(localdir, item)).st_mtime for item
in files]+[0])
botmsg = data['botlog'].strip()
@@ -586,7 +590,7 @@
data.update({ 'time': asctime(localtime(time())),
'oldlog': ", ".join(files),
- 'oldlink': r"../DrTrigonBot/",
+ 'oldlink': links['old'][style.host(os.environ)],
'logstat': os.path.basename(sys.argv[0]) +
r"?action=logstat",
'logstatraw': os.path.basename(sys.argv[0]) +
r"?action=logstat&format=plain",
'refresh': '15',
--
To view, visit https://gerrit.wikimedia.org/r/113688
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I766b4ef92fb36b6ba755481117e62be61bfba58b
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/bots/drtrigonbot
Gerrit-Branch: master
Gerrit-Owner: DrTrigon <[email protected]>
Gerrit-Reviewer: DrTrigon <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits