Changeset 172
- Timestamp:
- 12/20/05 19:34:30 (18 years ago)
- Location:
- trunk/soft/ObsData
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/soft/ObsData/ObsData/Repository.pm
- Property cvs2svn:cvs-rev changed from 1.58 to 1.59
r171 r172 241 241 archivefile => $file, 242 242 ); 243 if(!$orda->do_continue('do_archive' )) {243 if(!$orda->do_continue('do_archive', "Should I parse $file")) { 244 244 $self->logging(0, 245 245 "Archive %s/%s allready parsed, skipping", … … 517 517 } 518 518 519 =head3 do_continue($why, @args)519 =head3 do_continue($why, $message, @args) 520 520 521 521 Perform default or call the interactive callback. … … 527 527 528 528 sub do_continue { 529 my ($self, $why, @args) = @_; 530 531 my $oevent = ObsData::Event->new($why, $why); 529 my ($self, $why, $message, @args) = @_; 530 531 $self->logging(0, "Event($why): $message"); 532 my $oevent = ObsData::Event->new($why, $message); 532 533 $self->populate_event( 533 534 $oevent, @args 534 535 ); 535 536 536 if ($self->{interative_callback}) { 537 return $self->{interative_callback}->($self, $oevent); 538 } else { 539 return $self->default_choice($oevent); 540 } 537 my $res = 538 $self->{interative_callback} ? 539 $self->{interative_callback}->($self, $oevent) : 540 $self->default_choice($oevent); 541 $self->logging(0, "Event(%s): Result: %s", $why, $res); 542 return($res); 541 543 } 542 544 … … 638 640 } 639 641 640 if(!$self->do_continue('overwrite', $datafile, $destfile)) { 642 if(!$self->do_continue( 643 'overwrite', 644 "Should I overwrite $destfile", 645 $datafile, 646 $destfile)) { 641 647 $self->logging(3, 642 648 "%s extracted from %s/%s already exists, I won't overwrite it", … … 712 718 713 719 foreach my $data ($self->list_archive) { 714 if (!$self->do_continue('do_data', $data)) { 720 if (!$self->do_continue( 721 'do_data', 722 "Should I extract $data from $self->{archivefile}", 723 $data)) { 715 724 $self->logging(0, 716 725 "%s/%s has allready processed, skipping", -
trunk/soft/ObsData/t/OR-03.t
- Property cvs2svn:cvs-rev changed from 1.11 to 1.12
r168 r172 52 52 ok($or->get_data_value('ozone34', 'BAR') eq 'BAR', "can get a value"); 53 53 54 ok($or->do_continue('overwrite', ' a', 'a') eq 1, "Perform do_continue");54 ok($or->do_continue('overwrite', '-', 'a', 'a') eq 1, "Perform do_continue"); 55 55 ok($callbackwhy eq 'overwrite', "arg are properly passed to callback"); 56 56 ok($or->list_archive, "Can list archive content");
Note: See TracChangeset
for help on using the changeset viewer.