Replace # for module description by """ (help auto extraction)

This commit is contained in:
Grégory Soutadé 2014-12-19 11:34:25 +01:00
parent 2f05a70ee5
commit a35d462cb7
16 changed files with 422 additions and 421 deletions

View File

@ -2,9 +2,9 @@ import os
# Default configuration # Default configuration
# Default directory where to store database information # Default database directory
DB_ROOT = './output_db' DB_ROOT = './output_db'
# Default directory where to create html files # Default HTML output directory
DISPLAY_ROOT = './output' DISPLAY_ROOT = './output'
# Hooks directories (don't edit) # Hooks directories (don't edit)
@ -49,7 +49,7 @@ icon_path = '%s/%s' % (os.path.basename(resources_path[0]), 'icon')
# CSS path (you can add yours) # CSS path (you can add yours)
css_path = ['%s/%s/%s' % (os.path.basename(resources_path[0]), 'css', 'iwla.css')] css_path = ['%s/%s/%s' % (os.path.basename(resources_path[0]), 'css', 'iwla.css')]
# Extensions to compress in gzip during display build # Extensions to compress in gzip during display build
compress_output_files = [] compress_output_files = []
# Path to locales files # Path to locales files

165
iwla.py
View File

@ -41,88 +41,89 @@ del _
from iplugin import * from iplugin import *
from display import * from display import *
# """
# Main class IWLA Main class IWLA
# Parse Log, compute them, call plugins and produce output Parse Log, compute them, call plugins and produce output
# For now, only HTTP log are valid For now, only HTTP log are valid
#
# Plugin requirements : Plugin requirements :
# None None
#
# Conf values needed : Conf values needed :
# analyzed_filename analyzed_filename
# domain_name domain_name
# locales_path locales_path
# compress_output_files* compress_output_files*
#
# Output files : Output files :
# DB_ROOT/meta.db DB_ROOT/meta.db
# DB_ROOT/year/month/iwla.db DB_ROOT/year/month/iwla.db
# OUTPUT_ROOT/index.html OUTPUT_ROOT/index.html
# OUTPUT_ROOT/year/month/index.html OUTPUT_ROOT/year/month/index.html
#
# Statistics creation : Statistics creation :
#
# meta : meta :
# last_time last_time
# start_analysis_time start_analysis_time
# stats => stats =>
# year => year =>
# month => month =>
# viewed_bandwidth viewed_bandwidth
# not_viewed_bandwidth not_viewed_bandwidth
# viewed_pages viewed_pages
# viewed_hits viewed_hits
# nb_visits nb_visits
# nb_visitors nb_visitors
#
# month_stats : month_stats :
# viewed_bandwidth viewed_bandwidth
# not_viewed_bandwidth not_viewed_bandwidth
# viewed_pages viewed_pages
# viewed_hits viewed_hits
# nb_visits nb_visits
#
# days_stats : days_stats :
# day => day =>
# viewed_bandwidth viewed_bandwidth
# not_viewed_bandwidth not_viewed_bandwidth
# viewed_pages viewed_pages
# viewed_hits viewed_hits
# nb_visits nb_visits
# nb_visitors nb_visitors
#
# visits : visits :
# remote_addr => remote_addr =>
# remote_addr remote_addr
# remote_ip remote_ip
# viewed_pages viewed_pages
# viewed_hits viewed_hits
# not_viewed_pages not_viewed_pages
# not_viewed_hits not_viewed_hits
# bandwidth bandwidth
# last_access last_access
# requests => requests =>
# [fields_from_format_log] [fields_from_format_log]
# extract_request => extract_request =>
# extract_uri extract_uri
# extract_parameters* extract_parameters*
# extract_referer* => extract_referer* =>
# extract_uri extract_uri
# extract_parameters* extract_parameters*
# robot robot
# hit_only hit_only
# is_page is_page
#
# valid_visitors: valid_visitors:
# month_stats without robot and hit only visitors (if not conf.count_hit_only_visitors) month_stats without robot and hit only visitors (if not conf.count_hit_only_visitors)
#
# Statistics update : Statistics update :
# None None
#
# Statistics deletion : Statistics deletion :
# None None
# """
class IWLA(object): class IWLA(object):

View File

@ -24,30 +24,30 @@ from iwla import IWLA
from iplugin import IPlugin from iplugin import IPlugin
from display import * from display import *
# """
# Display hook Display hook
#
# Create All visits page Create All visits page
#
# Plugin requirements : Plugin requirements :
# None None
#
# Conf values needed : Conf values needed :
# display_visitor_ip* display_visitor_ip*
#
# Output files : Output files :
# OUTPUT_ROOT/year/month/all_visits.html OUTPUT_ROOT/year/month/all_visits.html
# OUTPUT_ROOT/year/month/index.html OUTPUT_ROOT/year/month/index.html
#
# Statistics creation : Statistics creation :
# None None
#
# Statistics update : Statistics update :
# None None
#
# Statistics deletion : Statistics deletion :
# None None
# """
class IWLADisplayAllVisits(IPlugin): class IWLADisplayAllVisits(IPlugin):
def __init__(self, iwla): def __init__(self, iwla):

View File

@ -22,34 +22,34 @@ from iwla import IWLA
from iplugin import IPlugin from iplugin import IPlugin
from display import * from display import *
# """
# Display hook Display hook
#
# Create Referers page Create Referers page
#
# Plugin requirements : Plugin requirements :
# post_analysis/referers post_analysis/referers
#
# Conf values needed : Conf values needed :
# max_referers_displayed* max_referers_displayed*
# create_all_referers_page* create_all_referers_page*
# max_key_phrases_displayed* max_key_phrases_displayed*
# create_all_key_phrases_page* create_all_key_phrases_page*
#
# Output files : Output files :
# OUTPUT_ROOT/year/month/referers.html OUTPUT_ROOT/year/month/referers.html
# OUTPUT_ROOT/year/month/key_phrases.html OUTPUT_ROOT/year/month/key_phrases.html
# OUTPUT_ROOT/year/month/index.html OUTPUT_ROOT/year/month/index.html
#
# Statistics creation : Statistics creation :
# None None
#
# Statistics update : Statistics update :
# None None
#
# Statistics deletion : Statistics deletion :
# None None
# """
class IWLADisplayReferers(IPlugin): class IWLADisplayReferers(IPlugin):
def __init__(self, iwla): def __init__(self, iwla):

View File

@ -22,31 +22,31 @@ from iwla import IWLA
from iplugin import IPlugin from iplugin import IPlugin
from display import * from display import *
# """
# Display hook Display hook
#
# Create TOP downloads page Create TOP downloads page
#
# Plugin requirements : Plugin requirements :
# post_analysis/top_downloads post_analysis/top_downloads
#
# Conf values needed : Conf values needed :
# max_downloads_displayed* max_downloads_displayed*
# create_all_downloads_page* create_all_downloads_page*
#
# Output files : Output files :
# OUTPUT_ROOT/year/month/top_downloads.html OUTPUT_ROOT/year/month/top_downloads.html
# OUTPUT_ROOT/year/month/index.html OUTPUT_ROOT/year/month/index.html
#
# Statistics creation : Statistics creation :
# None None
#
# Statistics update : Statistics update :
# None None
#
# Statistics deletion : Statistics deletion :
# None None
# """
class IWLADisplayTopDownloads(IPlugin): class IWLADisplayTopDownloads(IPlugin):
def __init__(self, iwla): def __init__(self, iwla):

View File

@ -22,31 +22,31 @@ from iwla import IWLA
from iplugin import IPlugin from iplugin import IPlugin
from display import * from display import *
# """
# Display hook Display hook
#
# Create TOP hits page Create TOP hits page
#
# Plugin requirements : Plugin requirements :
# post_analysis/top_hits post_analysis/top_hits
#
# Conf values needed : Conf values needed :
# max_hits_displayed* max_hits_displayed*
# create_all_hits_page* create_all_hits_page*
#
# Output files : Output files :
# OUTPUT_ROOT/year/month/top_hits.html OUTPUT_ROOT/year/month/top_hits.html
# OUTPUT_ROOT/year/month/index.html OUTPUT_ROOT/year/month/index.html
#
# Statistics creation : Statistics creation :
# None None
#
# Statistics update : Statistics update :
# None None
#
# Statistics deletion : Statistics deletion :
# None None
# """
class IWLADisplayTopHits(IPlugin): class IWLADisplayTopHits(IPlugin):
def __init__(self, iwla): def __init__(self, iwla):

View File

@ -22,31 +22,31 @@ from iwla import IWLA
from iplugin import IPlugin from iplugin import IPlugin
from display import * from display import *
# """
# Display hook Display hook
#
# Create TOP pages page Create TOP pages page
#
# Plugin requirements : Plugin requirements :
# post_analysis/top_pages post_analysis/top_pages
#
# Conf values needed : Conf values needed :
# max_pages_displayed* max_pages_displayed*
# create_all_pages_page* create_all_pages_page*
#
# Output files : Output files :
# OUTPUT_ROOT/year/month/top_pages.html OUTPUT_ROOT/year/month/top_pages.html
# OUTPUT_ROOT/year/month/index.html OUTPUT_ROOT/year/month/index.html
#
# Statistics creation : Statistics creation :
# None None
#
# Statistics update : Statistics update :
# None None
#
# Statistics deletion : Statistics deletion :
# None None
# """
class IWLADisplayTopPages(IPlugin): class IWLADisplayTopPages(IPlugin):
def __init__(self, iwla): def __init__(self, iwla):

View File

@ -24,29 +24,29 @@ from iwla import IWLA
from iplugin import IPlugin from iplugin import IPlugin
from display import * from display import *
# """
# Display hook Display hook
#
# Create TOP visitors block Create TOP visitors block
#
# Plugin requirements : Plugin requirements :
# None None
#
# Conf values needed : Conf values needed :
# display_visitor_ip* display_visitor_ip*
#
# Output files : Output files :
# OUTPUT_ROOT/year/month/index.html OUTPUT_ROOT/year/month/index.html
#
# Statistics creation : Statistics creation :
# None None
#
# Statistics update : Statistics update :
# None None
#
# Statistics deletion : Statistics deletion :
# None None
# """
class IWLADisplayTopVisitors(IPlugin): class IWLADisplayTopVisitors(IPlugin):
def __init__(self, iwla): def __init__(self, iwla):

View File

@ -26,40 +26,40 @@ from iplugin import IPlugin
import awstats_data import awstats_data
# """
# Post analysis hook Post analysis hook
#
# Extract referers and key phrases from requests Extract referers and key phrases from requests
#
# Plugin requirements : Plugin requirements :
# None None
#
# Conf values needed : Conf values needed :
# domain_name domain_name
#
# Output files : Output files :
# None None
#
# Statistics creation : Statistics creation :
# None None
#
# Statistics update : Statistics update :
# month_stats : month_stats :
# referers => referers =>
# pages pages
# hits hits
# robots_referers => robots_referers =>
# pages pages
# hits hits
# search_engine_referers => search_engine_referers =>
# pages pages
# hits hits
# key_phrases => key_phrases =>
# phrase phrase
#
# Statistics deletion : Statistics deletion :
# None None
# """
class IWLAPostAnalysisReferers(IPlugin): class IWLAPostAnalysisReferers(IPlugin):
def __init__(self, iwla): def __init__(self, iwla):

View File

@ -23,32 +23,32 @@ import socket
from iwla import IWLA from iwla import IWLA
from iplugin import IPlugin from iplugin import IPlugin
# """
# Post analysis hook Post analysis hook
#
# Replace IP by reverse DNS names Replace IP by reverse DNS names
#
# Plugin requirements : Plugin requirements :
# None None
#
# Conf values needed : Conf values needed :
# reverse_dns_timeout* reverse_dns_timeout*
#
# Output files : Output files :
# None None
#
# Statistics creation : Statistics creation :
# None None
#
# Statistics update : Statistics update :
# valid_visitors: valid_visitors:
# remote_addr remote_addr
# dns_name_replaced dns_name_replaced
# dns_analyzed dns_analyzed
#
# Statistics deletion : Statistics deletion :
# None None
# """
class IWLAPostAnalysisReverseDNS(IPlugin): class IWLAPostAnalysisReverseDNS(IPlugin):
DEFAULT_DNS_TIMEOUT = 0.5 DEFAULT_DNS_TIMEOUT = 0.5

View File

@ -23,31 +23,31 @@ import re
from iwla import IWLA from iwla import IWLA
from iplugin import IPlugin from iplugin import IPlugin
# """
# Post analysis hook Post analysis hook
#
# Count TOP downloads Count TOP downloads
#
# Plugin requirements : Plugin requirements :
# None None
#
# Conf values needed : Conf values needed :
# None None
#
# Output files : Output files :
# None None
#
# Statistics creation : Statistics creation :
# None None
#
# Statistics update : Statistics update :
# month_stats: month_stats:
# top_downloads => top_downloads =>
# uri uri
#
# Statistics deletion : Statistics deletion :
# None None
# """
class IWLAPostAnalysisTopDownloads(IPlugin): class IWLAPostAnalysisTopDownloads(IPlugin):
def __init__(self, iwla): def __init__(self, iwla):

View File

@ -21,31 +21,31 @@
from iwla import IWLA from iwla import IWLA
from iplugin import IPlugin from iplugin import IPlugin
# """
# Post analysis hook Post analysis hook
#
# Count TOP hits Count TOP hits
#
# Plugin requirements : Plugin requirements :
# None None
#
# Conf values needed : Conf values needed :
# None None
#
# Output files : Output files :
# None None
#
# Statistics creation : Statistics creation :
# None None
#
# Statistics update : Statistics update :
# month_stats: month_stats:
# top_hits => top_hits =>
# uri uri
#
# Statistics deletion : Statistics deletion :
# None None
# """
class IWLAPostAnalysisTopHits(IPlugin): class IWLAPostAnalysisTopHits(IPlugin):
def __init__(self, iwla): def __init__(self, iwla):

View File

@ -23,31 +23,31 @@ import re
from iwla import IWLA from iwla import IWLA
from iplugin import IPlugin from iplugin import IPlugin
# """
# Post analysis hook Post analysis hook
#
# Count TOP pages Count TOP pages
#
# Plugin requirements : Plugin requirements :
# None None
#
# Conf values needed : Conf values needed :
# None None
#
# Output files : Output files :
# None None
#
# Statistics creation : Statistics creation :
# None None
#
# Statistics update : Statistics update :
# month_stats: month_stats:
# top_pages => top_pages =>
# uri uri
#
# Statistics deletion : Statistics deletion :
# None None
# """
class IWLAPostAnalysisTopPages(IPlugin): class IWLAPostAnalysisTopPages(IPlugin):
def __init__(self, iwla): def __init__(self, iwla):

View File

@ -23,31 +23,31 @@ import re
from iwla import IWLA from iwla import IWLA
from iplugin import IPlugin from iplugin import IPlugin
# """
# Pre analysis hook Pre analysis hook
# Change page into hit and hit into page into statistics Change page into hit and hit into page into statistics
#
# Plugin requirements : Plugin requirements :
# None None
#
# Conf values needed : Conf values needed :
# page_to_hit_conf* page_to_hit_conf*
# hit_to_page_conf* hit_to_page_conf*
#
# Output files : Output files :
# None None
#
# Statistics creation : Statistics creation :
# None None
#
# Statistics update : Statistics update :
# visits : visits :
# remote_addr => remote_addr =>
# is_page is_page
#
# Statistics deletion : Statistics deletion :
# None None
# """
class IWLAPreAnalysisPageToHit(IPlugin): class IWLAPreAnalysisPageToHit(IPlugin):

View File

@ -25,32 +25,32 @@ from iplugin import IPlugin
import awstats_data import awstats_data
# """
# Pre analysis hook Pre analysis hook
#
# Filter robots Filter robots
#
# Plugin requirements : Plugin requirements :
# None None
#
# Conf values needed : Conf values needed :
# page_to_hit_conf* page_to_hit_conf*
# hit_to_page_conf* hit_to_page_conf*
#
# Output files : Output files :
# None None
#
# Statistics creation : Statistics creation :
# None None
#
# Statistics update : Statistics update :
# visits : visits :
# remote_addr => remote_addr =>
# robot robot
#
# Statistics deletion : Statistics deletion :
# None None
# """
class IWLAPreAnalysisRobots(IPlugin): class IWLAPreAnalysisRobots(IPlugin):
def __init__(self, iwla): def __init__(self, iwla):