IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 31, 2011, 2:51:48 PM (15 years ago)
Author:
eugene
Message:

merging changes from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101205/tools/czartool/Pantasks.pm

    r29076 r30446  
    120120        chomp($line);
    121121        if (!$self->outputOk($line)) {return \@labels;}
    122         if ($line =~ m/pantasks:\s+/) {$passedHeader=1; next;}
    123         if ($passedHeader) {push(@labels, $line);}
     122
     123        # sometimes a label can be on the same line as the panstasks prompt
     124        if ($line =~ m/pantasks: (.*)/) {
     125            $line = $1;
     126            $passedHeader=1;
     127        }
     128
     129        if ($passedHeader && length($line) > 0){push(@labels, $line);}
    124130    }
    125131
     
    191197    }
    192198}
     199
     200###########################################################################
     201#
     202# Gets current dates for this server
     203#
     204###########################################################################
     205sub getDates {
     206    my ($self, $server) = @_;
     207
     208    my @dates;
     209
     210    my $prefix;
     211
     212    if ($server eq "stdscience") {$prefix = "ns";}
     213    elsif ($server eq "registration") {$prefix = "register";}
     214
     215    my @cmdOut = `echo "$prefix.show.dates;quit" | pantasks_client -c ~ipp/$server/ptolemy.rc 2>&1`;
     216    my $line;
     217    my $passedHeader=0;
     218    foreach $line (@cmdOut) {
     219
     220        chomp($line);
     221        if (!$self->outputOk($line)) {return \@dates;}
     222
     223        # sometimes content is on same line as pantasks prompt
     224        if ($line =~ m/pantasks: (.*)/) {
     225            $line =~ s/pantasks: //;
     226                $passedHeader=1;
     227        }
     228
     229        if ($passedHeader && length($line) > 0){
     230
     231            # strip out only the date part
     232            if ($line =~ m/([0-9]{4}-[0-9]{2}-[0-9]{2}).*/) {
     233
     234                push(@dates, $1);
     235            }
     236        }
     237    }
     238
     239    return \@dates;
     240}
     241
     242
    1932431;
Note: See TracChangeset for help on using the changeset viewer.