Changeset 255


Ignore:
Timestamp:
06/22/09 03:19:38 (15 years ago)
Author:
nanardon
Message:
  • update POD
File:
1 edited

Legend:

Unmodified
Added
Removed
  • LATMOS-Accounts/lib/LATMOS/Accounts.pm

    r192 r255  
    88use LATMOS::Accounts::Synchro; 
    99use LATMOS::Accounts::SynchAccess; 
     10use LATMOS::Accounts::Log; 
    1011 
    1112our $VERSION = (q$Rev$ =~ /^Rev: (\d+) /)[0]; 
     13 
     14=head1 NAME 
     15 
     16LATMOS::Accounts - Core module for LATMOS account management tools 
     17 
     18=head1 DESCRITPTION 
     19 
     20=cut 
     21 
     22=head1 FUNCTION 
     23 
     24=head2 new($configfile) 
     25 
     26Instanciate a new LATMOS::Accounts object. 
     27 
     28$configfile if defined is the Config::IniFiles formatted file to use, 
     29default to F</etc/latmos-account.ini>. 
     30 
     31=cut 
    1232 
    1333sub new { 
     
    2343    bless($self, $class) 
    2444} 
     45 
     46=head2 list_bases 
     47 
     48Return the base list found in config file 
     49 
     50=cut 
     51 
     52sub list_bases { 
     53    my ($self) = @_; 
     54    grep { 
     55        !m/^_.*_$/ && 
     56        !m/^sync:/ 
     57    } $self->Sections 
     58} 
     59 
     60=head2 base($basename) 
     61 
     62Return a L<LATMOS::Accounts::Base> object over base named $basename 
     63defined in the config file. 
     64 
     65The base is loaded by this function. 
     66 
     67=cut 
    2568 
    2669sub base { 
     
    3073    $self->load_base($section) ? $self->{_bases}{$section} : undef; 
    3174} 
     75 
     76=head2 default_base_name 
     77 
     78Return the default base name according config file 
     79 
     80=cut 
     81 
     82sub default_base_name { 
     83    my ($self) = @_; 
     84    $self->val('_default_', 'base', ($self->list_bases)[0]); 
     85} 
     86 
     87=head2 default_base 
     88 
     89Return a L<LATMOS::Accounts::Base> object over the default base according 
     90configuration file. 
     91 
     92=cut 
    3293 
    3394sub default_base { 
     
    54115    ); 
    55116    my $base = LATMOS::Accounts::Bases->new($type, %params, label => $section) or do { 
    56         warn "Cannot instanciate base $section ($type)"; 
     117        la_log(LA_WARN, "Cannot instanciate base $section ($type)"); 
    57118        return; 
    58119    }; 
     
    61122} 
    62123 
    63 sub default_base_name { 
    64     my ($self) = @_; 
    65     $self->val('_default_', 'base', ($self->list_bases)[0]); 
    66 } 
    67  
    68124sub default_synchro_name { 
    69125    my ($self) = @_; 
    70126    $self->val('_default_', 'sync'); 
    71 } 
    72  
    73 sub list_bases { 
    74     my ($self) = @_; 
    75     grep { 
    76         !m/^_.*_$/ && 
    77         !m/^sync:/ 
    78     } $self->Sections 
    79127} 
    80128 
     
    88136    foreach ($self->list_bases) { 
    89137        $self->load_base($_) or do { 
    90             warn "Cannot load base $_\n"; 
     138            la_log(LA_ERR, "Cannot load base $_"); 
    91139            return 0; 
    92140        }; 
     
    159207 
    160208__END__ 
    161 # Below is stub documentation for your module. You'd better edit it! 
    162  
    163 =head1 NAME 
    164  
    165 LATMOS::Accounts - Perl extension for blah blah blah 
    166  
    167 =head1 SYNOPSIS 
    168  
    169   use LATMOS::Accounts; 
    170   blah blah blah 
    171  
    172 =head1 DESCRIPTION 
    173  
    174 Stub documentation for LATMOS::Accounts, created by h2xs. It looks like the 
    175 author of the extension was negligent enough to leave the stub 
    176 unedited. 
    177  
    178 Blah blah blah. 
    179  
    180 =head2 EXPORT 
    181  
    182 None by default. 
    183  
    184  
    185209 
    186210=head1 SEE ALSO 
    187211 
    188 Mention other useful documentation such as the documentation of 
    189 related modules or operating system documentation (such as man pages 
    190 in UNIX), or any relevant external documentation such as RFCs or 
    191 standards. 
    192  
    193 If you have a mailing list set up for your module, mention it here. 
    194  
    195 If you have a web site set up for your module, mention it here. 
    196  
    197212=head1 AUTHOR 
    198213 
    199 Thauvin Olivier, E<lt>olivier.thauvin@latmosipsl.frE<gt> 
     214Thauvin Olivier, E<lt>olivier.thauvin@latmos.ipsl.frE<gt> 
    200215 
    201216=head1 COPYRIGHT AND LICENSE 
     
    207222at your option, any later version of Perl 5 you may have available. 
    208223 
    209  
    210 =cut 
     224=cut 
Note: See TracChangeset for help on using the changeset viewer.