DrTrigon has submitted this change and it was merged.

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(-)

Approvals:
  DrTrigon: Verified; Looks good to me, approved



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: merged
Gerrit-Change-Id: Ia65314248f0f2106d7f084813d4ddd49cb5d28d7
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/bots/drtrigonbot
Gerrit-Branch: master
Gerrit-Owner: DrTrigon <dr.tri...@surfeu.ch>
Gerrit-Reviewer: DrTrigon <dr.tri...@surfeu.ch>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to