Set two digits for month numbers
This commit is contained in:
parent
2c3d8d22f8
commit
f116eacbcc
2
conf.py
2
conf.py
|
@ -10,7 +10,7 @@ display_visitor_ip = True
|
||||||
|
|
||||||
# Hooks used
|
# Hooks used
|
||||||
pre_analysis_hooks = ['page_to_hit', 'robots']
|
pre_analysis_hooks = ['page_to_hit', 'robots']
|
||||||
post_analysis_hooks = ['referers', 'top_pages', 'top_downloads', 'top_hits', 'reverse_dns']
|
post_analysis_hooks = ['referers', 'top_pages', 'top_downloads', 'top_hits'] #, 'reverse_dns']
|
||||||
display_hooks = ['top_visitors', 'all_visits', 'referers', 'top_pages', 'top_downloads', 'top_hits']
|
display_hooks = ['top_visitors', 'all_visits', 'referers', 'top_pages', 'top_downloads', 'top_hits']
|
||||||
|
|
||||||
# Reverse DNS timeout
|
# Reverse DNS timeout
|
||||||
|
|
12
iwla.py
12
iwla.py
|
@ -174,7 +174,7 @@ class IWLA(object):
|
||||||
|
|
||||||
def getCurDisplayPath(self, filename):
|
def getCurDisplayPath(self, filename):
|
||||||
cur_time = self.meta_infos['last_time']
|
cur_time = self.meta_infos['last_time']
|
||||||
return os.path.join(str(cur_time.tm_year), str(cur_time.tm_mon), filename)
|
return os.path.join(str(cur_time.tm_year), '%02d' % (cur_time.tm_mon), filename)
|
||||||
|
|
||||||
def getResourcesPath(self):
|
def getResourcesPath(self):
|
||||||
return conf.resources_path
|
return conf.resources_path
|
||||||
|
@ -194,7 +194,7 @@ class IWLA(object):
|
||||||
return self.display
|
return self.display
|
||||||
|
|
||||||
def getDBFilename(self, time):
|
def getDBFilename(self, time):
|
||||||
return os.path.join(conf.DB_ROOT, str(time.tm_year), '%02d' % time.tm_mon, conf.DB_FILENAME)
|
return os.path.join(conf.DB_ROOT, str(time.tm_year), '%02d' % (time.tm_mon), conf.DB_FILENAME)
|
||||||
|
|
||||||
def _serialize(self, obj, filename):
|
def _serialize(self, obj, filename):
|
||||||
base = os.path.dirname(filename)
|
base = os.path.dirname(filename)
|
||||||
|
@ -336,7 +336,7 @@ class IWLA(object):
|
||||||
|
|
||||||
def _generateDisplayDaysStats(self):
|
def _generateDisplayDaysStats(self):
|
||||||
cur_time = self.meta_infos['last_time']
|
cur_time = self.meta_infos['last_time']
|
||||||
title = 'Stats %d/%d' % (cur_time.tm_mon, cur_time.tm_year)
|
title = 'Stats %d/%02d' % (cur_time.tm_year, cur_time.tm_mon)
|
||||||
filename = self.getCurDisplayPath('index.html')
|
filename = self.getCurDisplayPath('index.html')
|
||||||
print '==> Generate display (%s)' % (filename)
|
print '==> Generate display (%s)' % (filename)
|
||||||
page = self.display.createPage(title, filename, conf.css_path)
|
page = self.display.createPage(title, filename, conf.css_path)
|
||||||
|
@ -405,7 +405,7 @@ class IWLA(object):
|
||||||
full_month = '%s %d' % (months_name[i], year)
|
full_month = '%s %d' % (months_name[i], year)
|
||||||
if i in month_stats.keys():
|
if i in month_stats.keys():
|
||||||
stats = month_stats[i]
|
stats = month_stats[i]
|
||||||
link = '<a href="%d/%d/index.html">Details</a>' % (year, i)
|
link = '<a href="%d/%02d/index.html">Details</a>' % (year, i)
|
||||||
row = [full_month, stats['nb_visitors'], stats['viewed_pages'], stats['viewed_hits'],
|
row = [full_month, stats['nb_visitors'], stats['viewed_pages'], stats['viewed_hits'],
|
||||||
stats['viewed_bandwidth'], stats['not_viewed_bandwidth'], link]
|
stats['viewed_bandwidth'], stats['not_viewed_bandwidth'], link]
|
||||||
for j in graph_cols:
|
for j in graph_cols:
|
||||||
|
@ -488,7 +488,7 @@ class IWLA(object):
|
||||||
duplicated_stats = {k:v for (k,v) in stats.items()}
|
duplicated_stats = {k:v for (k,v) in stats.items()}
|
||||||
|
|
||||||
cur_time = self.meta_infos['last_time']
|
cur_time = self.meta_infos['last_time']
|
||||||
print "== Stats for %d/%d ==" % (cur_time.tm_year, cur_time.tm_mon)
|
print "== Stats for %d/%02d ==" % (cur_time.tm_year, cur_time.tm_mon)
|
||||||
print stats
|
print stats
|
||||||
|
|
||||||
if not 'month_stats' in self.current_analysis.keys():
|
if not 'month_stats' in self.current_analysis.keys():
|
||||||
|
@ -535,7 +535,7 @@ class IWLA(object):
|
||||||
stats = self._generateStats(visits)
|
stats = self._generateStats(visits)
|
||||||
|
|
||||||
cur_time = self.meta_infos['last_time']
|
cur_time = self.meta_infos['last_time']
|
||||||
print "== Stats for %d/%d/%d ==" % (cur_time.tm_year, cur_time.tm_mon, cur_time.tm_mday)
|
print "== Stats for %d/%02d/%d ==" % (cur_time.tm_year, cur_time.tm_mon, cur_time.tm_mday)
|
||||||
|
|
||||||
if cur_time.tm_mday > 1:
|
if cur_time.tm_mday > 1:
|
||||||
last_day = cur_time.tm_mday - 1
|
last_day = cur_time.tm_mday - 1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user