iwla

iwla Commit Details

Date:2015-01-02 19:27:57 (6 years 7 months ago)
Author:Grégory Soutadé
Branch:dev, master
Commit:b1cdb3024396faa9b8e6e07737280b1490d0b204
Parents: cfe8510970fdde50e9b620340eebfc376b5ac1af
Message:Add analysis duration in result

Changes:
Miwla.py (4 diffs)

File differences

iwla.py
3131
3232
3333
34
34
3535
3636
3737
......
136136
137137
138138
139
139140
140141
141142
......
484485
485486
486487
487
488
488489
490
491
492
493
494
495
496
489497
490498
491499
......
654662
655663
656664
665
666
657667
658668
659669
import logging
import gettext
from calendar import monthrange
from datetime import date
from datetime import date, datetime
import default_conf as conf
import conf as _
self.meta_infos = {}
self.analyse_started = False
self.current_analysis = {}
self.start_time = 0
self.cache_plugins = {}
self.display = DisplayHTMLBuild(self)
self.valid_visitors = None
page = self.display.createPage(title, filename, conf.css_path)
last_update = '<b>%s</b> %s<br />' % (self._('Last update'), time.strftime('%02d %b %Y %H:%M', time.localtime()))
last_update = u'<b>%s</b> %s<br />' % (self._(u'Last update'), time.strftime('%02d %b %Y %H:%M', time.localtime()))
page.appendBlock(self.display.createBlock(DisplayHTMLRaw, last_update))
duration = datetime.now() - self.start_time
duration = time.gmtime(duration.seconds)
time_analysis = u'<b>%s</b> ' % (self._('Time analysis'))
if duration.tm_hour:
time_analysis += u'%d %s, ' % (duration.tm_hour, self._(u'hours'))
time_analysis += u'%d %s and %d %s<br />' % (duration.tm_min, self._(u'minutes'), duration.tm_sec, self._(u'seconds'))
page.appendBlock(self.display.createBlock(DisplayHTMLRaw, time_analysis))
for year in sorted(self.meta_infos['stats'].keys(), reverse=True):
self._generateDisplayMonthStats(page, year, self.meta_infos['stats'][year])
return True
def start(self, _file):
self.start_time = datetime.now()
self.logger.info('==> Load previous database')
self.meta_infos = self._deserialize(conf.META_PATH) or self._clearMeta()

Archive Download the corresponding diff file

Branches

Tags