iwla

iwla Commit Details

Date:2014-12-01 21:13:35 (6 years 7 months ago)
Author:Grégory Soutadé
Branch:dev, master
Commit:5d6362105b0b520fba1f792a3066d563bd127bb7
Parents: 81c3aa8099d37a0c6d73e77f2366f36e7272f9f8
Message:Save month stats in meta dictionary

Changes:
Mdefault_conf.py (1 diff)
Miwla.py (3 diffs)

File differences

default_conf.py
99
1010
1111
12
12
1313
1414
1515
PRE_HOOK_DIRECTORY = HOOKS_ROOT + '.pre_analysis'
POST_HOOK_DIRECTORY = HOOKS_ROOT + '.post_analysis'
DISPLAY_HOOK_DIRECTORY = HOOKS_ROOT + '.display'
META_PATH = DB_ROOT + 'meta.db'
META_PATH = os.path.join(DB_ROOT, 'meta.db')
DB_FILENAME = 'iwla.db'
log_format = '$server_name:$server_port $remote_addr - $remote_user [$time_local] ' +\
iwla.py
114114
115115
116116
117
117
118118
119119
120120
......
317317
318318
319319
320
320321
321322
322323
......
344345
345346
346347
348
349
350
351
352
353
354
355
356
347357
348358
349359
os.makedirs(base)
# TODO : remove return
return
#return
with open(filename + '.tmp', 'wb+') as f:
pickle.dump(obj, f)
visits = self.current_analysis['visits']
stats = self._generateStats(visits)
duplicated_stats = {k:v for (k,v) in stats.items()}
cur_time = self.meta_infos['last_time']
print "== Stats for %d/%d ==" % (cur_time.tm_year, cur_time.tm_mon)
self._generateDisplay()
# Save month stats
year = '%d' % (cur_time.tm_year)
month = '%d' % (cur_time.tm_mon)
if not 'stats' in self.meta_infos.keys():
self.meta_infos['stats'] = {}
if not year in self.meta_infos['stats'].keys():
self.meta_infos['stats'][year] = {}
self.meta_infos['stats'][year][month] = duplicated_stats
def _generateDayStats(self):
visits = self.current_analysis['visits']

Archive Download the corresponding diff file

Branches

Tags