From: Andy B. <ax...@us...> - 2005-01-30 15:36:40
|
Update of /cvsroot/xmltv/xmltv/grab/uk_rt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10192/grab/uk_rt Modified Files: tv_grab_uk_rt.in Log Message: Added --gui option to tv_grab_uk_rt and fixed a missing import in Ask.pm. Index: tv_grab_uk_rt.in =================================================================== RCS file: /cvsroot/xmltv/xmltv/grab/uk_rt/tv_grab_uk_rt.in,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** tv_grab_uk_rt.in 23 Jan 2005 20:05:02 -0000 1.75 --- tv_grab_uk_rt.in 30 Jan 2005 15:36:23 -0000 1.76 *************** *** 10,14 **** tv_grab_uk_rt --help ! tv_grab_uk_rt [--config-file FILE] --configure tv_grab_uk_rt [--config-file FILE] [--output FILE] [--quiet] --- 10,14 ---- tv_grab_uk_rt --help ! tv_grab_uk_rt [--config-file FILE] --configure [--gui OPTION] tv_grab_uk_rt [--config-file FILE] [--output FILE] [--quiet] *************** *** 31,34 **** --- 31,39 ---- configuration file. + B<--gui OPTION> Use this option to enable a graphical interface to be used. + OPTION may be 'Tk', or left blank for the best available choice. + Additional allowed values of OPTION are 'Term' for normal terminal output + (default) and 'TermNoProgressBar' to disable the use of Term::ProgressBar. + B<--config-file FILE> Set the name of the configuration file, the default is B<~/.xmltv/tv_grab_uk_rt.conf>. This is the file written by B<--configure> and *************** *** 67,70 **** --- 72,76 ---- use XMLTV::Get_nice; use XMLTV::Ask; + use XMLTV::ProgressBar; use XMLTV::Memoize; XMLTV::Memoize::check_argv 'get_nice'; use XMLTV::DST; *************** *** 94,103 **** } - # Use Term::ProgressBar if installed. - use constant Have_bar => eval { require Term::ProgressBar; 1 }; - GetOptions('help' => \ my $opt_help, 'configure' => \ my $opt_configure, 'config-file=s' => \ my $opt_config_file, 'output=s' => \ my $opt_output, 'share=s' => \ my $opt_share, # also undocumented --- 100,107 ---- } GetOptions('help' => \ my $opt_help, 'configure' => \ my $opt_configure, 'config-file=s' => \ my $opt_config_file, + 'gui:s' => \ my $opt_gui, 'output=s' => \ my $opt_output, 'share=s' => \ my $opt_share, # also undocumented *************** *** 125,128 **** --- 129,134 ---- (my $CHANNEL_NAMES_FILE = "$OUR_SHARE_DIR/channel_ids") =~ tr!/!/!s; + XMLTV::Ask::init($opt_gui); + # Stuff for the root <tv> element. my %tv_credits = ( # 'source-info-url' => "todo", *************** *** 167,173 **** # Whatever we're doing, we need the channel list. ! my $bar = Term::ProgressBar->new({ name => 'finding channels', ! count => 1 }) ! if Have_bar and not $opt_quiet; my $channel_list = get_nice $channel_list_uri; my (%channels, %seen_rt_id, %seen_name); --- 173,178 ---- # Whatever we're doing, we need the channel list. ! my $bar = new XMLTV::ProgressBar({name => 'finding channels', count => 1}) ! if not $opt_quiet; my $channel_list = get_nice $channel_list_uri; my (%channels, %seen_rt_id, %seen_name); *************** *** 189,193 **** 'display-name' => \@names }; } ! update $bar if $bar; foreach (keys %xmltv_to_rt) { warn "channel $_ ($xmltv_to_rt{$_}) not seen on site" --- 194,199 ---- 'display-name' => \@names }; } ! update $bar; ! $bar->finish(); foreach (keys %xmltv_to_rt) { warn "channel $_ ($xmltv_to_rt{$_}) not seen on site" *************** *** 353,358 **** } ! $bar = Term::ProgressBar->new({ name => 'grabbing', count => scalar @wanted_chs }) ! if Have_bar and not $opt_quiet; my %warned_wrong_num_fields; # give that warning once per channel file foreach my $ch (@wanted_chs) { --- 359,364 ---- } ! $bar = new XMLTV::ProgressBar({name => 'grabbing', count => scalar @wanted_chs}) ! if not $opt_quiet; my %warned_wrong_num_fields; # give that warning once per channel file foreach my $ch (@wanted_chs) { *************** *** 469,471 **** --- 475,478 ---- update $bar if $bar; } + $bar->finish(); $writer->end; |