Changeset 81


Ignore:
Timestamp:
11/30/05 14:22:52 (19 years ago)
Author:
thauvin
Message:
  • start function status
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/soft/ObsData/ObsData/Repository.pm

    • Property cvs2svn:cvs-rev changed from 1.20 to 1.21
    r78 r81  
    100100our @ISA = qw(ObsData::Repository); 
    101101 
     102my $status_default = { 
     103    archive_new => 1, 
     104    archive_time => 0, 
     105    archive_size => 0, 
     106 
     107    data_new => 1, 
     108    data_configmtime => 0, 
     109     
     110}; 
     111 
    102112sub new { 
    103113    my ($class, $parent, $archivefile) = @_; 
     
    106116 
    107117    $ORa->{archivefile} = $archivefile; 
     118     
     119    $ORa->{statusinfo} = {}; 
    108120     
    109121    bless($ORa, $class); 
     
    115127#    $self->SUPER::DESTROY(); 
    116128#} 
     129 
     130sub status { 
     131    my ($self) = @_; 
     132 
     133    my @filestats = stat("$self->{dir}/$self->{archivefile}"); 
     134 
     135    if ($self->{status}->SectionExists($self->{archivefile})) { 
     136    } else { 
     137        $self->{statusinfo}{archive_new} = 
     138            $self->loging(0, "%s is new files", $self->{archivefile}); 
     139    } 
     140} 
    117141 
    118142# TODO Define return code for this function, storing result somewhere to 
     
    191215    } else { 
    192216        $self->loging(0, "%s is new files", $self->{archivefile}); 
    193         $self->{status}->AddSection($self->{archivefile}); 
    194217        $self->update_status; 
    195218        return 1; 
     
    200223    my ($self) = @_; 
    201224    my @filestats = stat("$self->{dir}/$self->{archivefile}"); 
    202      
     225    if (!$self->{status}->SectionExists($self->{archivefile})) { 
     226        $self->{status}->AddSection($self->{archivefile}); 
     227    } 
    203228    $self->{status}->newval($self->{archivefile}, 'mtime', $filestats[9]); 
    204229    $self->{status}->newval($self->{archivefile}, 'size', $filestats[7]); 
Note: See TracChangeset for help on using the changeset viewer.