lilalo

diff l3config.pm @ 33:e22df843b512

Поддержка /l3/current/index
author devi
date Mon Nov 14 09:16:28 2005 +0200 (2005-11-14)
parents 196c82b6e538
children 34f3ce44c365
line diff
     1.1 --- a/l3config.pm	Fri Nov 11 21:29:49 2005 +0200
     1.2 +++ b/l3config.pm	Mon Nov 14 09:16:28 2005 +0200
     1.3 @@ -1,3 +1,4 @@
     1.4 +
     1.5  package l3config;
     1.6  
     1.7  use Exporter;
     1.8 @@ -7,7 +8,11 @@
     1.9  @ISA = ('Exporter');
    1.10  @EXPORT = qw(%Config &init_config);
    1.11  
    1.12 -our $Config_File = "labmaker.conf";
    1.13 +our $System_Config_File = "/etc/lilalo.conf";
    1.14 +our $User_Config_File = "$ENV{HOME}/.lilalo.conf";
    1.15 +$ENV{HOME} ||= "/tmp";
    1.16 +
    1.17 +
    1.18  our %Config = (
    1.19  		"skip_empty" 			=> 	"yes",
    1.20  		"skip_interrupted" 		=>	"no",
    1.21 @@ -28,24 +33,23 @@
    1.22  
    1.23  		"head_lines"			=> 	5,
    1.24  		"tail_lines"			=>	5,
    1.25 -		"cache_head_lines"			=> 	50,
    1.26 -		"cache_tail_lines"			=>	50,
    1.27 +		"cache_head_lines"		=> 	50,
    1.28 +		"cache_tail_lines"		=>	50,
    1.29  		"skip_text"			=>	"...",
    1.30  		"show_time"			=>	"yes",
    1.31  		"show_diffs"			=>	"yes",
    1.32  		"show_comments"			=>	"yes",
    1.33  		"show_notes"			=>	"yes",
    1.34  
    1.35 -		"input"				=>	"/root/.labmaker",
    1.36 +		"input"				=>	"$ENV{HOME}/.lilalo",
    1.37  		"diffs"				=>	"",
    1.38  		"input_mask"			=>	"*.script",
    1.39  		"encoding"			=> 	"utf-8",
    1.40  
    1.41 -		"cache"				=>	"/tmp/report.xml",
    1.42 -		"cache_stat"			=>	"/tmp/.report.dat",
    1.43 +		"cache"				=>	"$ENV{HOME}/.lilalo/report.xml",
    1.44 +		"cache_stat"			=>	"$ENV{HOME}/.lilalo/.report.dat",
    1.45  
    1.46  		"output"			=>	"/tmp/report.html",
    1.47 -		#"output"			=>	"report.xml",
    1.48  		"output_mask"			=>	"INDEX",
    1.49  		"output_format"			=>	"html",
    1.50  		"frontend_css"			=>	"/l3/l3.css",
    1.51 @@ -74,12 +78,12 @@
    1.52  		"mode"				=>	"daemon",		# daemon | normal
    1.53  		"daemon_sleep_interval"		=>	"1",
    1.54  		"detach"			=>	"yes",
    1.55 -		"agent_pidfile"			=> 	"$ENV{HOME}/.labmaker/l3-agent.pid",
    1.56 +		"agent_pidfile"			=> 	"$ENV{HOME}/.lilalo/l3-agent.pid",
    1.57  
    1.58  		"backend_address"		=>	"127.0.0.1",
    1.59  		"backend_port"			=> 	"18030",
    1.60  		"backend_pidfile"		=> 	"/tmp/l3-backend.pid",
    1.61 -		"backend_datafile"		=> 	"/tmp/backend.xml",
    1.62 +		"backend_datafile"		=> 	"/var/lilalo/lablogs-xml/backend.xml",
    1.63  
    1.64  		"l3-agent"			=>	"l3-agent", 
    1.65  		"l3-backend"			=>	"l3-backend", 
    1.66 @@ -91,7 +95,7 @@
    1.67  		"course-trainer" => "", 
    1.68  		"course-student" => "", 
    1.69  
    1.70 -
    1.71 +		"filter" => "",
    1.72  		#lm
    1.73  		"show_host" 	=> "no",
    1.74  
    1.75 @@ -144,7 +148,8 @@
    1.76  {
    1.77  	my %argv_config;
    1.78  	my %file_config;
    1.79 -	read_config_file(\%file_config, $Config_File);
    1.80 +	read_config_file(\%file_config, $System_Config_File);
    1.81 +	read_config_file(\%file_config, $User_Config_File);
    1.82  	GetOptions(\%argv_config, map "$_=s", keys %Config);
    1.83  	%Config = (%Config, %file_config, %argv_config);
    1.84  }