Changeset 172


Ignore:
Timestamp:
12/20/05 19:34:30 (18 years ago)
Author:
thauvin
Message:
  • pass both id and message to do_continue
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  
    241241            archivefile => $file, 
    242242        ); 
    243         if(!$orda->do_continue('do_archive')) { 
     243        if(!$orda->do_continue('do_archive', "Should I parse $file")) { 
    244244            $self->logging(0, 
    245245                "Archive %s/%s allready parsed, skipping", 
     
    517517} 
    518518 
    519 =head3 do_continue($why, @args) 
     519=head3 do_continue($why, $message, @args) 
    520520 
    521521Perform default or call the interactive callback. 
     
    527527 
    528528sub 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); 
    532533    $self->populate_event( 
    533534        $oevent, @args 
    534535    ); 
    535536 
    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); 
    541543} 
    542544 
     
    638640    } 
    639641     
    640     if(!$self->do_continue('overwrite', $datafile, $destfile)) { 
     642    if(!$self->do_continue( 
     643            'overwrite', 
     644            "Should I overwrite $destfile", 
     645            $datafile,  
     646            $destfile)) { 
    641647        $self->logging(3, 
    642648            "%s extracted from %s/%s already exists, I won't overwrite it", 
     
    712718 
    713719    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)) { 
    715724            $self->logging(0, 
    716725                "%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  
    5252    ok($or->get_data_value('ozone34', 'BAR') eq 'BAR', "can get a value"); 
    5353 
    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"); 
    5555    ok($callbackwhy eq 'overwrite', "arg are properly passed to callback"); 
    5656    ok($or->list_archive, "Can list archive content"); 
Note: See TracChangeset for help on using the changeset viewer.