iwla

iwla Commit Details

Date:2014-12-19 18:06:02 (6 years 7 months ago)
Author:Grégory Soutadé
Branch:dev, master
Commit:046c1d898300a8f755f2dd41362083a892a74630
Parents: a14600ccda887f1724c8fd09327018f023d6396a
Message:Use a clear conf file

Changes:
Mconf.py (2 diffs)
Mdefault_conf.py (1 diff)
Miwla.py (2 diffs)

File differences

conf.py
1
12
23
3
4
45
56
67
......
1011
1112
1213
13
14
1415
1516
1617
1718
1819
1920
20
21
22
21
22
23
2324
2425
2526
2627
2728
29
2830
2931
32
3033
3134
# -*- coding: utf-8 -*-
# Web server log
analyzed_filename = 'access.log'
analyzed_filename = '/var/log/apache2/access.log'
# Domain name to analyze
domain_name = 'soutade.fr'
# Hooks used
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']
# Reverse DNS timeout
reverse_dns_timeout = 0.2
# Count this addresses as hit
page_to_hit_conf = [r'^.+/logo[/]?$']
# Count this addresses as page
hit_to_page_conf = [r'^.+/category/.+$', r'^.+/tag/.+$', r'^.+/archive/.+$', r'^.+/ljdc[/]?$']
#page_to_hit_conf = [r'^.+/logo[/]?$']
## Count this addresses as page
#hit_to_page_conf = [r'^.+/category/.+$', r'^.+/tag/.+$', r'^.+/archive/.+$', r'^.+/ljdc[/]?$']
# Because it's too long to build HTML when there is too much entries
max_hits_displayed = 100
max_downloads_displayed = 100
# Compress these files after generation
compress_output_files = ['html', 'css', 'js']
# Display result in French
locale = 'fr'
default_conf.py
1
2
13
24
35
# -*- coding: utf-8 -*-
import os
# Default configuration
iwla.py
240240
241241
242242
243
243
244244
245245
246
247
246
248247
249248
250249
......
485484
486485
487486
488
489
490
487
488
491489
492490
493491
# TODO : remove return
#return
with open(filename + '.tmp', 'wb+') as f:
with open(filename + '.tmp', 'wb+') as f, gzip.open(filename, 'w') as fzip:
pickle.dump(obj, f)
f.seek(0)
with gzip.open(filename, 'w') as fzip:
fzip.write(f.read())
fzip.write(f.read())
os.remove(filename + '.tmp')
def _deserialize(self, filename):
if not os.path.exists(gz_path) or\
os.stat(path).st_mtime > build_time:
with open(path, 'rb') as f_in:
with gzip.open(gz_path, 'wb') as f_out:
f_out.write(f_in.read())
with open(path, 'rb') as f_in, gzip.open(gz_path, 'wb') as f_out:
f_out.write(f_in.read())
def _compressFiles(self, build_time, root):
if not conf.compress_output_files: return

Archive Download the corresponding diff file

Branches

Tags