[Bio] / FigKernelPackages / FIG.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FIG.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.222, Sat Feb 12 06:49:27 2005 UTC revision 1.223, Sat Feb 12 17:20:43 2005 UTC
# Line 6846  Line 6846 
6846   Get or set the classification of the subsystem. Added by RAE in response to the changes made on seed wiki   Get or set the classification of the subsystem. Added by RAE in response to the changes made on seed wiki
6847   If a reference to an array is supplied it is saved as the new classification of the subsystem.   If a reference to an array is supplied it is saved as the new classification of the subsystem.
6848   Regardless, the current classification is returned as a reference to an array. There is no control over what the things are.   Regardless, the current classification is returned as a reference to an array. There is no control over what the things are.
6849   Returns undef if a valid subsystem is not supplied, or if no classification is known   Returns a reference to an empty array if a valid subsystem is not supplied, or if no classification is known
6850    
6851   The classification is stored as a \t separated list of things in $subsys/CLASSIFICATION. There is no control over what the things are.   The classification is stored as a \t separated list of things in $subsys/CLASSIFICATION. There is no control over what the things are.
6852    
# Line 6857  Line 6857 
6857   my ($self, $ssa, $classification)=@_;   my ($self, $ssa, $classification)=@_;
6858   $ssa =~ s/[ \/]/_/g;   $ssa =~ s/[ \/]/_/g;
6859    
6860   return unless (-d "$FIG_Config::data/Subsystems/$ssa/");   my $return=['', '', ''];
6861    
6862     return $return unless (-d "$FIG_Config::data/Subsystems/$ssa/");
6863   if ($classification && ref($classification) eq "ARRAY") {   if ($classification && ref($classification) eq "ARRAY") {
6864    # append this to the end of the file. Note that appending doesn't require that the file already exist.    # append this to the end of the file. Note that appending doesn't require that the file already exist.
6865    open (OUT, ">>$FIG_Config::data/Subsystems/$ssa/CLASSIFICATION") || die "Can't open $FIG_Config::data/Subsystems/$ssa/CLASSIFICATION for appending";    open (OUT, ">>$FIG_Config::data/Subsystems/$ssa/CLASSIFICATION") || die "Can't open $FIG_Config::data/Subsystems/$ssa/CLASSIFICATION for appending";
# Line 6868  Line 6870 
6870   return unless (-e "$FIG_Config::data/Subsystems/$ssa/CLASSIFICATION");   return unless (-e "$FIG_Config::data/Subsystems/$ssa/CLASSIFICATION");
6871   # now read the file, and return the last line we find   # now read the file, and return the last line we find
6872   open (IN, "<$FIG_Config::data/Subsystems/$ssa/CLASSIFICATION") || die "Can't open $FIG_Config::data/Subsystems/$ssa/CLASSIFICATION for reading";   open (IN, "<$FIG_Config::data/Subsystems/$ssa/CLASSIFICATION") || die "Can't open $FIG_Config::data/Subsystems/$ssa/CLASSIFICATION for reading";
  my $class;  
6873   while (<IN>) {   while (<IN>) {
6874    chomp;    chomp;
6875    @$class=split /\t/;    @$return = split /\t/;
6876   }   }
6877   close IN;   close IN;
6878   return $class;   return $return;
6879  }  }
6880    
6881  =pod  =pod

Legend:
Removed from v.1.222  
changed lines
  Added in v.1.223

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3