IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12830


Ignore:
Timestamp:
Apr 12, 2007, 5:15:04 PM (19 years ago)
Author:
Paul Price
Message:

Making metadata lookup functions public.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-Config/lib/PS/IPP/Config.pm

    r12799 r12830  
    11# Copyright (c) 2006  Paul Price, Joshua Hoblitt
    22#
    3 # $Id: Config.pm,v 1.34 2007-04-11 01:58:02 eugene Exp $
     3# $Id: Config.pm,v 1.35 2007-04-13 03:15:04 price Exp $
    44
    55package PS::IPP::Config;
     
    2727    $PS_EXIT_DATA_ERROR
    2828    $PS_EXIT_TIMEOUT_ERROR
     29    metadataLookupStr
     30    metadataLookupMD
    2931);
    3032
     
    7072    my $mdc = $parser->parse( join '', @contents); # The parsed metadata config
    7173
    72     my $path = _interpolate_env(_mdLookupStr($mdc, 'PATH')); # The path
     74    my $path = _interpolate_env(metadataLookupStr($mdc, 'PATH')); # The path
    7375    unless (defined $path) {
    7476        carp "PATH is not set in $name\n";
     
    101103    }
    102104
    103     my $camera_list = _mdLookupMD($self->{_ipprc}, 'CAMERAS'); # List of cameras
    104     my $filename = _mdLookupStr($camera_list, $name); # Filename of camera configuration
     105    my $camera_list = metadataLookupMD($self->{_ipprc}, 'CAMERAS'); # List of cameras
     106    my $filename = metadataLookupStr($camera_list, $name); # Filename of camera configuration
    105107    unless (defined $filename) {
    106108        carp "Unable to find configuration file for camera $name\n";
     
    165167    }
    166168
    167     my $path_list = _mdLookupMD($self->{_ipprc}, 'DATAPATH'); # List of paths
    168     my $pathname = _mdLookupStr($path_list, $name); # Path of interest
     169    my $path_list = metadataLookupMD($self->{_ipprc}, 'DATAPATH'); # List of paths
     170    my $pathname = metadataLookupStr($path_list, $name); # Path of interest
    169171    unless (defined $pathname) {
    170172        carp "Unable to find camera configuration file $pathname\n" ;
     
    229231    pop @dirs;                  # Get rid of filename
    230232
    231     my $path_list = _mdLookupMD($self->{_ipprc}, 'DATAPATH'); # List of paths
     233    my $path_list = metadataLookupMD($self->{_ipprc}, 'DATAPATH'); # List of paths
    232234    my $best_path;
    233235    my $best_name;
     
    285287    }
    286288
    287     my $rejection = _mdLookupMD($camera, 'REJECTION');  # Rejection list
     289    my $rejection = metadataLookupMD($camera, 'REJECTION');     # Rejection list
    288290    unless (defined $rejection) {
    289291        carp "Can't find REJECTION list in camera configuration.\n";
     
    346348    }
    347349
    348     my $filerules = _mdLookupMD($camera, 'FILERULES');  # File rules
     350    my $filerules = metadataLookupMD($camera, 'FILERULES');     # File rules
    349351    unless (defined $filerules) {
    350352        carp "Can't find FILERULES list in camera configuration.\n";
     
    358360    }
    359361
    360     my $filename = _mdLookupStr($file, "FILENAME.RULE"); # File name
     362    my $filename = metadataLookupStr($file, "FILENAME.RULE"); # File name
    361363    unless (defined $filename) {
    362364        carp "Can't find FILENAME.RULE for $name within FILERULES in camera configuration.\n";
     
    395397##      }
    396398## 
    397 ##      my $extname_rules = _mdLookupMD($camera, 'EXTNAME.RULES');      # File rules
     399##      my $extname_rules = metadataLookupMD($camera, 'EXTNAME.RULES'); # File rules
    398400##      unless (defined $extname_fules) {
    399401##      carp "Can't find EXTNAME.RULES in camera configuration.\n";
     
    401403##      }
    402404## 
    403 ##      my $extname = _mdLookupStr($file, $name); # File name
     405##      my $extname = metadataLookupStr($file, $name); # File name
    404406##      unless (defined $extname) {
    405407##      carp "Can't find $name within EXTNAME.RULES in camera configuration.\n";
     
    434436    }
    435437
    436     my $dir = _mdLookupStr($camera, "DVO.CAMERADIR"); # Directory of interest
     438    my $dir = metadataLookupStr($camera, "DVO.CAMERADIR"); # Directory of interest
    437439    unless (defined $dir) {
    438440        carp "Can't find DVO.CAMERADIR in camera configuration.\n";
     
    463465
    464466# Lookup the metadata, checking the type is STR
    465 sub _mdLookupStr
     467sub metadataLookupStr
    466468{
    467469    my $mdc = shift;            # Metadata config to look up
     
    486488
    487489# Lookup the metadata, checking the type is MD
    488 sub _mdLookupMD
     490sub metadataLookupMD
    489491{
    490492    my $mdc = shift;            # Metadata config to look up
     
    507509    return undef;
    508510}
    509 
    510511
    511512# Lookup the metadata, checking the type is MD; may be redirection
Note: See TracChangeset for help on using the changeset viewer.