[opendemo-cvs] CVS: opendemo/tools/odcut odcut.pl,1.47,1.48
Status: Beta
Brought to you by:
girlich
From: Uwe G. <gi...@us...> - 2004-10-31 21:50:52
|
Update of /cvsroot/opendemo/opendemo/tools/odcut In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29618 Modified Files: odcut.pl Log Message: Replace get_outputfile by directly accessing the config variable output_file. Replace set_outputfile by directly accessing the config variable output_file. Index: odcut.pl =================================================================== RCS file: /cvsroot/opendemo/opendemo/tools/odcut/odcut.pl,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** odcut.pl 31 Oct 2004 20:36:06 -0000 1.47 --- odcut.pl 31 Oct 2004 21:50:40 -0000 1.48 *************** *** 7,10 **** --- 7,11 ---- # TODO # correct 'e': cleaner ending + # moving game communication here *************** *** 42,46 **** ARGCOUNT => ARGCOUNT_ONE, ARGS => "=s", ! EXPAND => EXPAND_UID | EXPAND_VAR | EXPAND_ENV, } }); --- 43,47 ---- ARGCOUNT => ARGCOUNT_ONE, ARGS => "=s", ! EXPAND => EXPAND_ALL, } }); *************** *** 107,114 **** $config->define( "game_executable", { ! DEFAULT => '$game_dir/quake3.x86', }, ); # First parse the command line @ARGV. --- 108,117 ---- $config->define( "game_executable", { ! DEFAULT => $config->game_dir . "/quake3.x86", }, ); + # printf "exe=%s\n", $config->game_executable; + # First parse the command line @ARGV. *************** *** 502,506 **** @$self{keys %extra} = values %extra; } - $self->set_outputfile($config->output_file); $self->interactive(0); $self->range_running(0); --- 505,508 ---- *************** *** 644,668 **** - # Set the output file. - sub set_outputfile($$) - { - my ($self,$outputfile) = @_; - $self->{"outputfile"} = $outputfile; - } - - - # Get the output file. - sub get_outputfile($) - { - my $self = shift; - if (exists $self->{"outputfile"}) { - $self->{"outputfile"} - } - else { - undef; - } - } - - # Set the current time. sub set_time($$) --- 646,649 ---- *************** *** 837,845 **** if (!exists $self->{"outputFd"}) { ! main::logging 30, "opening %s\n", $self->get_outputfile(); ! $self->{"outputFd"} = new IO::File(">".$self->get_outputfile()); if (!defined $self->{"outputFd"}) { main::warning 0, "could not open %s for writing: $!\n", ! $self->get_outputfile(); delete $self->{"outputFd"}; return 0; --- 818,826 ---- if (!exists $self->{"outputFd"}) { ! main::logging 30, "opening %s\n", $self->{"config"}->output_file; ! $self->{"outputFd"} = new IO::File(">".$self->{"config"}->output_file); if (!defined $self->{"outputFd"}) { main::warning 0, "could not open %s for writing: $!\n", ! $self->{"config"}->output_file; delete $self->{"outputFd"}; return 0; *************** *** 864,868 **** if (exists $self->{"outputFd"}) { ! main::logging 30, "closing %s\n", $self->get_outputfile(); $self->{"outputFd"}->close(); # make sure, that no one can use it any more --- 845,849 ---- if (exists $self->{"outputFd"}) { ! main::logging 30, "closing %s\n", $self->{"config"}->output_file; $self->{"outputFd"}->close(); # make sure, that no one can use it any more *************** *** 886,895 **** else { main::warning 0, "error writing to %s: $!\n", ! $self->get_outputfile(); $self->close_output(); $self->open_output(); if (!exists $self->{"outputFd"}) { main::warning 0, "error opening %s\n", ! $self->get_outputfile(); # no other way out last; --- 867,876 ---- else { main::warning 0, "error writing to %s: $!\n", ! $self->{"config"}->output_file; $self->close_output(); $self->open_output(); if (!exists $self->{"outputFd"}) { main::warning 0, "error opening %s\n", ! $self->{"config"}->output_file; # no other way out last; *************** *** 1067,1078 **** elsif ($command->get_code() eq "o") { if ($command->get_argc() >= 1) { ! if ($command->get_arg(0) ne $self->get_outputfile()) { $self->close_output(); ! $self->set_outputfile($command->get_arg(0)); ! $result = $self->get_outputfile(); } } main::logging 0, "OUTPUT \"%s\"\n", ! $self->get_outputfile(); } # end command o elsif ($command->get_code() eq "b") { --- 1048,1059 ---- elsif ($command->get_code() eq "o") { if ($command->get_argc() >= 1) { ! if ($command->get_arg(0) ne $self->{"config"}->output_file) { $self->close_output(); ! $self->{"config"}->set("output_file",$command->get_arg(0)); ! $result = $self->{"config"}->output_file; } } main::logging 0, "OUTPUT \"%s\"\n", ! $self->{"config"}->output_file; } # end command o elsif ($command->get_code() eq "b") { |