DrTrigon has uploaded a new change for review.
https://gerrit.wikimedia.org/r/114626
Change subject: bugfix; back/next function needs the correct "today" date
......................................................................
bugfix; back/next function needs the correct "today" date
Change-Id: Ia65314248f0f2106d7f084813d4ddd49cb5d28d7
---
M public_html/cgi-bin/panel.py
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/bots/drtrigonbot
refs/changes/26/114626/1
diff --git a/public_html/cgi-bin/panel.py b/public_html/cgi-bin/panel.py
index aedf515..5fc1c45 100755
--- a/public_html/cgi-bin/panel.py
+++ b/public_html/cgi-bin/panel.py
@@ -550,6 +550,7 @@
if (datetime.datetime.today() - today) >= datetime.timedelta(days=2):
data['logbrowse'] += " | <a href='?date=%s'>next ></a><br><br>"
% tomorrow
data['logbrowse'] += "<br><br>"
+ today = mktime(today.timetuple())
stat, recent = logging_statistics(current, botcontinuous)
if stat is None:
@@ -566,7 +567,7 @@
data['botstate_daily'] = botstate_img['red']
color = html_color['red']
state_text = "n/a"
- if lastrun and ((time()-lastrun) <= (bottimeout*60*60)):
+ if lastrun and ((today-lastrun) <= (bottimeout*60*60)):
if (botmsg == botdonemsg) and not (stat['ecount']['end'] -
stat['ecount']['start']):
data['botstate_daily'] = botstate_img['green']
color = html_color['green']
@@ -615,7 +616,7 @@
logfile = os.path.join(localdir, item)
lasttime = os.stat(logfile).st_mtime
logstate = botstate_img['red']
- if (time()-lasttime) <= (bottimeout*60*60):
+ if (today-lasttime) <= (bottimeout*60*60):
if (s['lastmessage'] == botdonemsg) and not
(s['ecount']['end'] - s['ecount']['start']):
logstate = botstate_img['green']
elif (botmsg.find(botdonemsg) == 0):
--
To view, visit https://gerrit.wikimedia.org/r/114626
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia65314248f0f2106d7f084813d4ddd49cb5d28d7
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/bots/drtrigonbot
Gerrit-Branch: master
Gerrit-Owner: DrTrigon <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits