Use a clear conf file
This commit is contained in:
parent
a14600ccda
commit
046c1d8983
13
conf.py
13
conf.py
|
@ -1,6 +1,7 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Web server log
|
# Web server log
|
||||||
analyzed_filename = 'access.log'
|
analyzed_filename = '/var/log/apache2/access.log'
|
||||||
|
|
||||||
# Domain name to analyze
|
# Domain name to analyze
|
||||||
domain_name = 'soutade.fr'
|
domain_name = 'soutade.fr'
|
||||||
|
@ -10,22 +11,24 @@ 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
|
||||||
reverse_dns_timeout = 0.2
|
reverse_dns_timeout = 0.2
|
||||||
|
|
||||||
# Count this addresses as hit
|
# Count this addresses as hit
|
||||||
page_to_hit_conf = [r'^.+/logo[/]?$']
|
#page_to_hit_conf = [r'^.+/logo[/]?$']
|
||||||
# Count this addresses as page
|
## Count this addresses as page
|
||||||
hit_to_page_conf = [r'^.+/category/.+$', r'^.+/tag/.+$', r'^.+/archive/.+$', r'^.+/ljdc[/]?$']
|
#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
|
# Because it's too long to build HTML when there is too much entries
|
||||||
max_hits_displayed = 100
|
max_hits_displayed = 100
|
||||||
max_downloads_displayed = 100
|
max_downloads_displayed = 100
|
||||||
|
|
||||||
|
# Compress these files after generation
|
||||||
compress_output_files = ['html', 'css', 'js']
|
compress_output_files = ['html', 'css', 'js']
|
||||||
|
|
||||||
|
# Display result in French
|
||||||
locale = 'fr'
|
locale = 'fr'
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
# Default configuration
|
# Default configuration
|
||||||
|
|
10
iwla.py
10
iwla.py
|
@ -240,11 +240,10 @@ class IWLA(object):
|
||||||
# TODO : remove return
|
# TODO : remove return
|
||||||
#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)
|
pickle.dump(obj, f)
|
||||||
f.seek(0)
|
f.seek(0)
|
||||||
with gzip.open(filename, 'w') as fzip:
|
fzip.write(f.read())
|
||||||
fzip.write(f.read())
|
|
||||||
os.remove(filename + '.tmp')
|
os.remove(filename + '.tmp')
|
||||||
|
|
||||||
def _deserialize(self, filename):
|
def _deserialize(self, filename):
|
||||||
|
@ -485,9 +484,8 @@ class IWLA(object):
|
||||||
|
|
||||||
if not os.path.exists(gz_path) or\
|
if not os.path.exists(gz_path) or\
|
||||||
os.stat(path).st_mtime > build_time:
|
os.stat(path).st_mtime > build_time:
|
||||||
with open(path, 'rb') as f_in:
|
with open(path, 'rb') as f_in, gzip.open(gz_path, 'wb') as f_out:
|
||||||
with gzip.open(gz_path, 'wb') as f_out:
|
f_out.write(f_in.read())
|
||||||
f_out.write(f_in.read())
|
|
||||||
|
|
||||||
def _compressFiles(self, build_time, root):
|
def _compressFiles(self, build_time, root):
|
||||||
if not conf.compress_output_files: return
|
if not conf.compress_output_files: return
|
||||||
|
|
Loading…
Reference in New Issue
Block a user