/[webpac]/trunk2/lib/WebPAC.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk2/lib/WebPAC.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 441 by dpavlin, Tue Sep 14 17:07:59 2004 UTC revision 448 by dpavlin, Wed Sep 15 16:53:51 2004 UTC
# Line 209  sub open_isis { Line 209  sub open_isis {
209          if (my $s = $self->{'start_mfn'}) {          if (my $s = $self->{'start_mfn'}) {
210                  $log->info("skipping to MFN $s");                  $log->info("skipping to MFN $s");
211                  $startmfn = $s;                  $startmfn = $s;
212            } else {
213                    $self->{'start_mfn'} = $startmfn;
214          }          }
215    
216          $maxmfn = $startmfn + $self->{limit_mfn} if ($self->{limit_mfn});          $maxmfn = $startmfn + $self->{limit_mfn} if ($self->{limit_mfn});
# Line 264  sub open_isis { Line 266  sub open_isis {
266    
267          }          }
268    
269          $self->{'current_mfn'} = $startmfn;          $self->{'current_mfn'} = -1;
270          $self->{'last_pcnt'} = 0;          $self->{'last_pcnt'} = 0;
271    
272          $log->debug("max mfn: $maxmfn");          $log->debug("max mfn: $maxmfn");
# Line 287  sub fetch_rec { Line 289  sub fetch_rec {
289    
290          my $log = $self->_get_logger();          my $log = $self->_get_logger();
291    
292          my $mfn = $self->{'current_mfn'}++ || $log->logconfess("it seems that you didn't load database!");          $log->logconfess("it seems that you didn't load database!") unless ($self->{'current_mfn'});
293    
294            if ($self->{'current_mfn'} == -1) {
295                    $self->{'current_mfn'} = $self->{'start_mfn'};
296            } else {
297                    $self->{'current_mfn'}++;
298            }
299    
300            my $mfn = $self->{'current_mfn'};
301    
302          if ($mfn > $self->{'max_mfn'}) {          if ($mfn > $self->{'max_mfn'}) {
303                  $self->{'current_mfn'} = $self->{'max_mfn'};                  $self->{'current_mfn'} = $self->{'max_mfn'};
# Line 304  sub fetch_rec { Line 314  sub fetch_rec {
314          }          }
315  }  }
316    
317    =head2 mfn
318    
319    Returns current record number (MFN).
320    
321     print $webpac->mfn;
322    
323    =cut
324    
325    sub mfn {
326            my $self = shift;
327            return $self->{'current_mfn'};
328    }
329    
330  =head2 progress_bar  =head2 progress_bar
331    
332  Draw progress bar on STDERR.  Draw progress bar on STDERR.

Legend:
Removed from v.441  
changed lines
  Added in v.448

  ViewVC Help
Powered by ViewVC 1.1.26