Changeset 6065


Ignore:
Timestamp:
2003-12-01T15:38:32+13:00 (20 years ago)
Author:
jrm21
Message:

changed (!defined nogroupyears) to (! nogroupyears) since parsargv always
defines it, setting it to either 0 or 1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/classify/DateList.pm

    r5645 r6065  
    7878        'args'     => $arguments };
    7979
    80 #  sub print_usage {
    81 #      print STDERR "
    82 #    usage: classify DateList [options]
    83 #    options:
    84 #   -bymonth  [or bymonth=1]    Classify by year and month
    85 
    86 #   Classifier plugin for sorting by date.
    87 #   Always sorts by 'Date' metadata.
    88 #   Date is assumed to be in the form yyyymmdd (all digits).
    89 #   By default dates are split by year - this should change.
    90 
    91 #   Any errors are Dana's problem.
    92 #  ";
    93 #  }
    9480
    9581sub new {
     
    10490
    10591    my ($datemeta, $sortmeta);
     92    $self->{'nogroupyears'}=0;
    10693    if (!parsargv::parse(\@_,
    10794                         q^bymonth^, \$self->{'bymonth'},
     
    188175    # top level
    189176    my $childtype = "HList";
    190     if (scalar (@$classlistref) <= 39 && !defined $self->{'nogroupyears'}) {$childtype = "DateList";}
     177
     178    if (scalar (@$classlistref) <= 39 &&
     179    !$self->{'nogroupyears'}) {$childtype = "DateList";}
    191180    my $classifyinfo = $self->get_entry ("Date", $childtype, "Invisible");
    192181
    193     # don't need to do any splitting if there are less than 39 (max + min -1) classifications, unless nogroupyears is specified
    194     if ((scalar @$classlistref) <= 39 && !defined $self->{'nogroupyears'}) {
     182    # don't need to do any splitting if there are less than 39 (max + min -1)
     183    # classifications, unless nogroupyears is specified
     184    if ((scalar @$classlistref) <= 39 && !$self->{'nogroupyears'}) {
    195185    foreach $subOID (@$classlistref) {
    196186        push (@{$classifyinfo->{'contains'}}, {'OID'=>$subOID});
     
    223213
    224214    # only compact the list if nogroupyears not specified
    225     if ( !defined $self->{'nogroupyears'}) {
     215    if (!$self->{'nogroupyears'}) {
    226216    $classhash = $self->compactlist ($classhash);
    227217    }
Note: See TracChangeset for help on using the changeset viewer.