Changeset 13312


Ignore:
Timestamp:
2006-11-22T10:38:19+13:00 (17 years ago)
Author:
kjdon
Message:

upgraded these so they work properly with classinfo.pl

Location:
trunk/niupepa/perllib/classify
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/niupepa/perllib/classify/NPDateList.pm

    r1023 r13312  
    3030use DateList;
    3131
     32use strict;
     33no strict 'refs'; # allow filehandles to be variables and viceversa
     34
    3235sub BEGIN {
    33     @ISA = ('DateList');
     36    @NPDateList::ISA = ('DateList');
     37}
     38
     39my $arguments;
     40
     41my $options = { 'name'     => "NPDateList",
     42        'desc'     => "Niupepa specific DateList",
     43        'abstract' => "no",
     44        'inherits' => "yes" };
     45
     46sub new {
     47    my ($class) = shift (@_);
     48    my ($classifierslist,$inputargs,$hashArgOptLists) = @_;
     49    push(@$classifierslist, $class);
     50
     51    if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
     52    if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
     53
     54    my $self = new DateList($classifierslist, $inputargs, $hashArgOptLists);
     55
     56    return bless $self, $class;
    3457}
    3558
  • trunk/niupepa/perllib/classify/NPepaList.pm

    r13309 r13312  
    2929package NPepaList;
    3030
     31use BasClas;
     32
     33use strict;
     34no strict 'refs'; # allow filehandles to be variables and viceversa
     35
     36sub BEGIN {
     37    @NPepaList::ISA = ('BasClas');
     38}
     39
     40my $arguments;
     41
     42my $options = { 'name'     => "NPepaList",
     43        'desc'     => "Classifies Niupepa documents by series",
     44        'abstract' => "no",
     45        'inherits' => "yes" };
     46
    3147sub new {
    32     my ($class, @options) = @_;
     48    my ($class) = shift (@_);
     49   
     50    my ($classifierslist,$inputargs,$hashArgOptLists) = @_;
     51    push(@$classifierslist, $class);
    3352
    34     return bless {
    35     'list'=>{},
    36     'metaname' => 'Series',
    37     'sortname' => 'Date'
    38     }, $class;
     53    if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
     54    if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
     55
     56    my $self = new BasClas($classifierslist, $inputargs, $hashArgOptLists);
     57
     58    if ($self->{'info_only'}) {
     59    # don't worry about any options etc
     60    return bless $self, $class;
     61    }
     62
     63    $self->{'list'} = {};
     64    $self->{'metaname'} = "Series";
     65    $self->{'sortname'} = "Date";
     66   
     67    return bless $self, $class;
     68
    3969}
    4070
     
    92122    my $classifyinfo = $self->get_entry ('Series', 'VList', 'Invisible');
    93123
    94     foreach $series (sort bydate keys %{$self->{'list'}}) {
     124    foreach my $series (sort bydate keys %{$self->{'list'}}) {
    95125    my $cinfo = $self->get_entry ($series, 'VList');
    96     foreach $OID (sort {$self->{'list'}->{$series}->{$a}
     126    foreach my $OID (sort {$self->{'list'}->{$series}->{$a}
    97127                cmp $self->{'list'}->{$series}->{$b};} keys %{$self->{'list'}->{$series}}) {
    98128        push (@{$cinfo->{'contains'}}, {'OID'=>$OID});
Note: See TracChangeset for help on using the changeset viewer.