Changeset 431
- Timestamp:
- 01/09/07 16:50:19 (6 years ago)
- Files:
-
- 2 modified
-
reconcilers/reconciler_mk2 (modified) (9 diffs)
-
status (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
reconcilers/reconciler_mk2
r421 r431 95 95 96 96 my $progname = "reconciler_mk2"; 97 my $version = "0.1 8";97 my $version = "0.19"; 98 98 99 99 use LWP::UserAgent; … … 104 104 use Data::Dumper; 105 105 use Compress::Zlib; 106 use Storable; 106 107 107 108 #### reconciler settings #### … … 219 220 my $opt = { }; 220 221 $opt->{output_file} = "output.xmltv"; 221 $opt->{config_file} = $progname.".config"; 222 $opt->{old_config_file} = $progname.".config"; 223 $opt->{config_file} = $progname.".storable.config"; 222 224 $opt->{log_file} = $progname.".log"; 223 225 $opt->{alt_title_file} = $progname.".alt_title.log"; … … 232 234 'channels_file=s' => \$opt->{channels_file}, 233 235 'preftitle=s' => \$opt->{preftitle}, 236 'old-config-file=s' => \$opt->{old_config_file}, 234 237 'config-file=s' => \$opt->{config_file}, 235 238 'log=s' => \$opt->{log_file}, … … 243 246 244 247 'print_listing' => \$reclogic{debug_print_programme_list}, 248 'dump_config' => \$opt->{dump_config}, 245 249 246 250 'help' => \$opt->{help}, … … 314 318 &log(1,"alternate titles to $opt->{alt_title_file}") unless $opt->{nolog}; 315 319 316 &read_config_file($opt->{config_file},0) if ($opt->{config_file}); 317 320 # convert from old Data::Dumper to newer Storable config file 321 if ((defined $opt->{old_config_file}) && (-r $opt->{old_config_file})) { 322 &read_config_file($opt->{old_config_file},0) if ($opt->{old_config_file}); 323 &write_config_file; 324 unlink($opt->{old_config_file}); 325 } 326 327 &read_storable_file($opt->{config_file}) if ($opt->{config_file}); 318 328 &show_settings; 319 329 … … 360 370 361 371 ###################################################################################################### 362 # read settings 372 # read settings (used for old config file and shepherd .conf files) 363 373 364 374 sub read_config_file … … 373 383 } 374 384 385 ###################################################################################################### 386 # used for reconciler new style config file 387 388 sub read_storable_file 389 { 390 my($file,$die_on_failure) = @_; 391 if (!(-r $file)) { 392 die "file $file could not be read. aborting.\n" if $die_on_failure; 393 return; 394 } 395 396 my $store = Storable::retrieve($file); 397 $setting_override = $store->{settings_override}; 398 $title_xlate_table = $store->{title_xlate_table}; 399 $title_history = $store->{title_history}; 400 401 if (defined $opt->{dump_config}) { 402 print Dumper($store); 403 exit(0); 404 } 405 } 375 406 376 407 ###################################################################################################### … … 387 418 } 388 419 389 open(CONF, ">$opt->{config_file}") || die "cannot write to $opt->{config_file}: $!"; 390 print CONF Data::Dumper->Dump( 391 [$setting_override, $title_xlate_table, $title_history], 392 ["setting_override", "title_xlate_table", "title_history" ]); 393 close CONF; 420 my $store; 421 $store->{settings_override} = $setting_override; 422 $store->{title_xlate_table} = $title_xlate_table; 423 $store->{title_history} = $title_history; 424 425 Storable::store($store, $opt->{config_file}); 394 426 &log(1,(sprintf "updated configuration file %s.\n",$opt->{config_file})); 395 427 } -
status
r429 r431 11 11 grabber yahoo7web 0.04 12 12 grabber ten_website 0.02 13 reconciler reconciler_mk2 0.1 814 postprocessor imdb_augment_data 0.0 713 reconciler reconciler_mk2 0.19 14 postprocessor imdb_augment_data 0.08 15 15 postprocessor augment_timezone 0.05
