From: John Graham-C. <jgr...@us...> - 2006-02-07 08:39:04
|
Update of /cvsroot/popfile/engine/POPFile In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18583/POPFile Modified Files: Tag: b0_22_2 Configuration.pm Log Message: Address the issue raised by patch 1410600. insert.pl and related scripts will now work in Japanese mode because the html_language parameter will be correctly loaded from the configuration file even if the HTML module is not loaded. This is a hack and needs to be addressed correctly in v0.23.x where the language is a per-user parameter. Index: Configuration.pm =================================================================== RCS file: /cvsroot/popfile/engine/POPFile/Configuration.pm,v retrieving revision 1.51.4.1 retrieving revision 1.51.4.2 diff -C2 -d -r1.51.4.1 -r1.51.4.2 *** Configuration.pm 6 Feb 2006 15:15:53 -0000 1.51.4.1 --- Configuration.pm 7 Feb 2006 08:38:53 -0000 1.51.4.2 *************** *** 329,335 **** # parse_command_line - Parse ARGV # ! # The arguments are the keys of the configuration hash. Any argument that is not already ! # defined in the hash generates an error, there must be an even number of ARGV elements because ! # each command argument has to have a value. # # ---------------------------------------------------------------------------- --- 329,336 ---- # parse_command_line - Parse ARGV # ! # The arguments are the keys of the configuration hash. Any argument ! # that is not already defined in the hash generates an error, there ! # must be an even number of ARGV elements because each command ! # argument has to have a value. # # ---------------------------------------------------------------------------- *************** *** 349,353 **** # So its possible to do # ! # --set bayes_param=value --set=-bayes_param=value --set -bayes_param=value -- -bayes_param value if ( !GetOptions( "set=s" => \@set_options ) ) { --- 350,355 ---- # So its possible to do # ! # --set bayes_param=value --set=-bayes_param=value --set ! # -bayes_param=value -- -bayes_param value if ( !GetOptions( "set=s" => \@set_options ) ) { *************** *** 355,361 **** } ! # Join together the options specified with --set and those after the --, the ! # options in @set_options are going to be of the form foo=bar and hence need to ! # be split into foo bar my @options; --- 357,363 ---- } ! # Join together the options specified with --set and those after ! # the --, the options in @set_options are going to be of the form ! # foo=bar and hence need to be split into foo bar my @options; *************** *** 386,390 **** my $parameter = $self->upgrade_parameter__($1); ! if ( defined($self->{configuration_parameters__}{$parameter}) ) { if ( $i < $#options ) { $self->parameter( $parameter, $options[$i+1] ); --- 388,392 ---- my $parameter = $self->upgrade_parameter__($1); ! if (defined($self->{configuration_parameters__}{$parameter})) { if ( $i < $#options ) { $self->parameter( $parameter, $options[$i+1] ); *************** *** 412,417 **** # upgrade_parameter__ # ! # Given a parameter from either command line or from the configuration file return the ! # upgraded version (e.g. the old port parameter becomes pop3_port # # ---------------------------------------------------------------------------- --- 414,420 ---- # upgrade_parameter__ # ! # Given a parameter from either command line or from the configuration ! # file return the upgraded version (e.g. the old port parameter ! # becomes pop3_port # # ---------------------------------------------------------------------------- *************** *** 434,440 **** 'corpus', 'bayes_corpus', ! 'unclassified_probability', 'bayes_unclassified_probability', ! # Parameters that are now handled by POPFile::Configuration 'piddir', 'config_piddir', --- 437,445 ---- 'corpus', 'bayes_corpus', ! 'unclassified_probability', ! 'bayes_unclassified_probability', ! # Parameters that are now handled by ! # POPFile::Configuration 'piddir', 'config_piddir', *************** *** 498,503 **** # load_configuration # ! # Loads the current configuration of popfile into the configuration hash from a local file. ! # The format is a very simple set of lines containing a space separated name and value pair # # ---------------------------------------------------------------------------- --- 503,509 ---- # load_configuration # ! # Loads the current configuration of popfile into the configuration ! # hash from a local file. The format is a very simple set of lines ! # containing a space separated name and value pair # # ---------------------------------------------------------------------------- *************** *** 518,523 **** $parameter = $self->upgrade_parameter__($parameter); ! if ( defined( $self->{configuration_parameters__}{$parameter} ) ) { ! $self->{configuration_parameters__}{$parameter}{value} = $value; } else { $self->{deprecated_parameters__}{$parameter} = $value; --- 524,537 ---- $parameter = $self->upgrade_parameter__($parameter); ! # There's a special hack here inserted so that even if ! # the HTML module is not loaded the html_language ! # parameter is loaded and not discarded. That's done ! # so that the Japanese users can use insert.pl ! # etc. which rely on knowing the language ! ! if (defined($self->{configuration_parameters__}{$parameter}) || ! ( $parameter eq 'html_language' ) ) { ! $self->{configuration_parameters__}{$parameter}{value} = ! $value; } else { $self->{deprecated_parameters__}{$parameter} = $value; *************** *** 536,540 **** # save_configuration # ! # Saves the current configuration of popfile from the configuration hash to a local file. # # ---------------------------------------------------------------------------- --- 550,555 ---- # save_configuration # ! # Saves the current configuration of popfile from the configuration ! # hash to a local file. # # ---------------------------------------------------------------------------- |