Changeset 220


Ignore:
Timestamp:
04/09/06 03:08:46 (18 years ago)
Author:
nanardon
Message:
  • add ObsData::get_sub_plugin()
Location:
trunk/soft/ObsData
Files:
2 edited

Legend:

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

    r219 r220  
    150150} 
    151151 
     152=head2 get_sub_plugin 
     153 
     154Return code ref of plugintype for datatype 
     155 
     156=cut 
     157 
     158sub get_sub_plugin { 
     159    my ($self, $datatype, $plugintype) = @_; 
     160    if (exists($self->{plugin}{$datatype}{$plugintype})) { 
     161        return $self->{plugin}{$datatype}{$plugintype}; 
     162    } else { 
     163        return undef; 
     164    } 
     165} 
     166 
    152167=head2 logging($level, $message, ...) 
    153168 
  • trunk/soft/ObsData/t/O-02.t

    r193 r220  
    44use warnings; 
    55 
    6 use Test::More tests => 20; 
     6use Test::More tests => 21; 
    77use File::Temp qw(tempdir); 
    88use POSIX qw(strftime); 
     
    3939ok(eq_set([ $o->get_datadir('ohp', 'ozone') ], [ 'testdata/ohp/ozone', 'testdata/ohp' ]) , 'Can retrive data directory'); 
    4040ok(eq_set([ $o->list_datatype ], [ 'oxygene', 'ozone' ]), "can get data type"); 
    41 print STDERR join(" ", $o->list_datatype); 
     41 
     42ok(ref $o->get_sub_plugin('ozone', 'match_plugin') eq 'CODE', 'can get plugin code'); 
    4243 
    4344$o = undef; # Explicit destroy 
Note: See TracChangeset for help on using the changeset viewer.