[Bio] / Sprout / Sprout.pm Repository:
ViewVC logotype

Diff of /Sprout/Sprout.pm

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

revision 1.39, Wed Sep 14 14:04:13 2005 UTC revision 1.55, Mon Apr 3 18:33:58 2006 UTC
# Line 92  Line 92 
92                                                          # database type                                                          # database type
93                         dataDir      => $FIG_Config::sproutData,                         dataDir      => $FIG_Config::sproutData,
94                                                          # data file directory                                                          # data file directory
95                         xmlFileName  => "$FIG_Config::sproutData/SproutDBD.xml",                         xmlFileName  => "$FIG_Config::fig/SproutDBD.xml",
96                                                          # database definition file name                                                          # database definition file name
97                         userData     => "$FIG_Config::dbuser/$FIG_Config::dbpass",                         userData     => "$FIG_Config::dbuser/$FIG_Config::dbpass",
98                                                          # user name and password                                                          # user name and password
# Line 389  Line 389 
389    
390  =head3 LoadUpdate  =head3 LoadUpdate
391    
392  C<< my %stats = $sprout->LoadUpdate($truncateFlag, \@tableList); >>  C<< my $stats = $sprout->LoadUpdate($truncateFlag, \@tableList); >>
393    
394  Load updates to one or more database tables. This method enables the client to make changes to one  Load updates to one or more database tables. This method enables the client to make changes to one
395  or two tables without reloading the whole database. For each table, there must be a corresponding  or two tables without reloading the whole database. For each table, there must be a corresponding
# Line 610  Line 610 
610          if ($prevContig eq $contigID && $dir eq $prevDir) {          if ($prevContig eq $contigID && $dir eq $prevDir) {
611              # Here the new segment is in the same direction on the same contig. Insure the              # Here the new segment is in the same direction on the same contig. Insure the
612              # new segment's beginning is next to the old segment's end.              # new segment's beginning is next to the old segment's end.
613              if (($dir eq "-" && $beg == $prevBeg - $prevLen) ||              if ($dir eq "-" && $beg + $len == $prevBeg) {
614                  ($dir eq "+" && $beg == $prevBeg + $prevLen)) {                  # Here we're merging two backward blocks, so we keep the new begin point
615                  # Here we need to merge two segments. Adjust the beginning and length values                  # and adjust the length.
616                  # to include both segments.                  $len += $prevLen;
617                    # Pop the old segment off. The new one will replace it later.
618                    pop @retVal;
619                } elsif ($dir eq "+" && $beg == $prevBeg + $prevLen) {
620                    # Here we need to merge two forward blocks. Adjust the beginning and
621                    # length values to include both segments.
622                  $beg = $prevBeg;                  $beg = $prevBeg;
623                  $len += $prevLen;                  $len += $prevLen;
624                  # Pop the old segment off. The new one will replace it later.                  # Pop the old segment off. The new one will replace it later.
# Line 659  Line 664 
664      shift if UNIVERSAL::isa($_[0],__PACKAGE__);      shift if UNIVERSAL::isa($_[0],__PACKAGE__);
665      my ($location) = @_;      my ($location) = @_;
666      # Parse it into segments.      # Parse it into segments.
667      $location =~ /^(.*)_(\d*)([+-_])(\d*)$/;      $location =~ /^(.+)_(\d+)([+\-_])(\d+)$/;
668      my ($contigID, $start, $dir, $len) = ($1, $2, $3, $4);      my ($contigID, $start, $dir, $len) = ($1, $2, $3, $4);
669      # If the direction is an underscore, convert it to a + or -.      # If the direction is an underscore, convert it to a + or -.
670      if ($dir eq "_") {      if ($dir eq "_") {
# Line 735  Line 740 
740  should be of the form returned by L</featureLocation> when in a list context. In other words,  should be of the form returned by L</featureLocation> when in a list context. In other words,
741  each location is of the form I<contigID>C<_>I<begin>I<dir>I<end>.  each location is of the form I<contigID>C<_>I<begin>I<dir>I<end>.
742    
743    For example, the following would return the DNA sequence for contig C<83333.1:NC_000913>
744    between positions 1401 and 1532, inclusive.
745    
746        my $sequence = $sprout->DNASeq('83333.1:NC_000913_1401_1532');
747    
748  =over 4  =over 4
749    
750  =item locationList  =item locationList
751    
752  List of location specifiers, each in the form I<contigID>C<_>I<begin>I<dir>I<end> (see  List of location specifiers, each in the form I<contigID>C<_>I<begin>I<dir>I<len> or
753  L</FeatureLocation> for more about this format).  I<contigID>C<_>I<begin>C<_>I<end> (see L</FeatureLocation> for more about this format).
754    
755  =item RETURN  =item RETURN
756    
# Line 869  Line 879 
879      # Set it from the sequence data, if any.      # Set it from the sequence data, if any.
880      if ($sequence) {      if ($sequence) {
881          my ($start, $len) = $sequence->Values(['IsMadeUpOf(start-position)', 'IsMadeUpOf(len)']);          my ($start, $len) = $sequence->Values(['IsMadeUpOf(start-position)', 'IsMadeUpOf(len)']);
882          $retVal = $start + $len;          $retVal = $start + $len - 1;
883        }
884        # Return the result.
885        return $retVal;
886    }
887    
888    =head3 ClusterPEGs
889    
890    C<< my $clusteredList = $sprout->ClusterPEGs($sub, \@pegs); >>
891    
892    Cluster the PEGs in a list according to the cluster coding scheme of the specified
893    subsystem. In order for this to work properly, the subsystem object must have
894    been used recently to retrieve the PEGs using the B<get_pegs_from_cell> method.
895    This causes the cluster numbers to be pulled into the subsystem's color hash.
896    If a PEG is not found in the color hash, it will not appear in the output
897    sequence.
898    
899    =over 4
900    
901    =item sub
902    
903    Sprout subsystem object for the relevant subsystem, from the L</get_subsystem>
904    method.
905    
906    =item pegs
907    
908    Reference to the list of PEGs to be clustered.
909    
910    =item RETURN
911    
912    Returns a list of the PEGs, grouped into smaller lists by cluster number.
913    
914    =back
915    
916    =cut
917    #: Return Type $@@;
918    sub ClusterPEGs {
919        # Get the parameters.
920        my ($self, $sub, $pegs) = @_;
921        # Declare the return variable.
922        my $retVal = [];
923        # Loop through the PEGs, creating arrays for each cluster.
924        for my $pegID (@{$pegs}) {
925            my $clusterNumber = $sub->get_cluster_number($pegID);
926            # Only proceed if the PEG is in a cluster.
927            if ($clusterNumber >= 0) {
928                # Push this PEG onto the sub-list for the specified cluster number.
929                push @{$retVal->[$clusterNumber]}, $pegID;
930            }
931      }      }
932      # Return the result.      # Return the result.
933      return $retVal;      return $retVal;
# Line 1019  Line 1077 
1077    
1078  =head3 FeatureAnnotations  =head3 FeatureAnnotations
1079    
1080  C<< my @descriptors = $sprout->FeatureAnnotations($featureID); >>  C<< my @descriptors = $sprout->FeatureAnnotations($featureID, $rawFlag); >>
1081    
1082  Return the annotations of a feature.  Return the annotations of a feature.
1083    
# Line 1029  Line 1087 
1087    
1088  ID of the feature whose annotations are desired.  ID of the feature whose annotations are desired.
1089    
1090    =item rawFlag
1091    
1092    If TRUE, the annotation timestamps will be returned in raw form; otherwise, they
1093    will be returned in human-readable form.
1094    
1095  =item RETURN  =item RETURN
1096    
1097  Returns a list of annotation descriptors. Each descriptor is a hash with the following fields.  Returns a list of annotation descriptors. Each descriptor is a hash with the following fields.
1098    
1099  * B<featureID> ID of the relevant feature.  * B<featureID> ID of the relevant feature.
1100    
1101  * B<timeStamp> time the annotation was made, in user-friendly format.  * B<timeStamp> time the annotation was made.
1102    
1103  * B<user> ID of the user who made the annotation  * B<user> ID of the user who made the annotation
1104    
# Line 1047  Line 1110 
1110  #: Return Type @%;  #: Return Type @%;
1111  sub FeatureAnnotations {  sub FeatureAnnotations {
1112      # Get the parameters.      # Get the parameters.
1113      my ($self, $featureID) = @_;      my ($self, $featureID, $rawFlag) = @_;
1114      # Create a query to get the feature's annotations and the associated users.      # Create a query to get the feature's annotations and the associated users.
1115      my $query = $self->Get(['IsTargetOfAnnotation', 'Annotation', 'MadeAnnotation'],      my $query = $self->Get(['IsTargetOfAnnotation', 'Annotation', 'MadeAnnotation'],
1116                             "IsTargetOfAnnotation(from-link) = ?", [$featureID]);                             "IsTargetOfAnnotation(from-link) = ?", [$featureID]);
# Line 1060  Line 1123 
1123              $annotation->Values(['IsTargetOfAnnotation(from-link)',              $annotation->Values(['IsTargetOfAnnotation(from-link)',
1124                                   'Annotation(time)', 'MadeAnnotation(from-link)',                                   'Annotation(time)', 'MadeAnnotation(from-link)',
1125                                   'Annotation(annotation)']);                                   'Annotation(annotation)']);
1126            # Convert the time, if necessary.
1127            if (! $rawFlag) {
1128                $timeStamp = FriendlyTimestamp($timeStamp);
1129            }
1130          # Assemble them into a hash.          # Assemble them into a hash.
1131          my $annotationHash = { featureID => $featureID,          my $annotationHash = { featureID => $featureID,
1132                                 timeStamp => FriendlyTimestamp($timeStamp),                                 timeStamp => $timeStamp,
1133                                 user => $user, text => $text };                                 user => $user, text => $text };
1134          # Add it to the return list.          # Add it to the return list.
1135          push @retVal, $annotationHash;          push @retVal, $annotationHash;
# Line 1091  Line 1158 
1158    
1159  =item RETURN  =item RETURN
1160    
1161  Returns a hash mapping the functional assignment IDs to user IDs.  Returns a hash mapping the user IDs to functional assignment IDs.
1162    
1163  =back  =back
1164    
# Line 1101  Line 1168 
1168      # Get the parameters.      # Get the parameters.
1169      my ($self, $featureID) = @_;      my ($self, $featureID) = @_;
1170      # Get all of the feature's annotations.      # Get all of the feature's annotations.
1171      my @query = $self->GetAll(['IsTargetOfAnnotation', 'Annotation'],      my @query = $self->GetAll(['IsTargetOfAnnotation', 'Annotation', 'MadeAnnotation'],
1172                              "IsTargetOfAnnotation(from-link) = ?",                              "IsTargetOfAnnotation(from-link) = ?",
1173                              [$featureID], ['Annotation(time)', 'Annotation(annotation)']);                              [$featureID], ['Annotation(time)', 'Annotation(annotation)',
1174                                               'MadeAnnotation(from-link)']);
1175      # Declare the return hash.      # Declare the return hash.
1176      my %retVal;      my %retVal;
     # Declare a hash for insuring we only make one assignment per user.  
     my %timeHash = ();  
1177      # Now we sort the assignments by timestamp in reverse.      # Now we sort the assignments by timestamp in reverse.
1178      my @sortedQuery = sort { -($a->[0] <=> $b->[0]) } @query;      my @sortedQuery = sort { -($a->[0] <=> $b->[0]) } @query;
1179      # Loop until we run out of annotations.      # Loop until we run out of annotations.
1180      for my $annotation (@sortedQuery) {      for my $annotation (@sortedQuery) {
1181          # Get the annotation fields.          # Get the annotation fields.
1182          my ($timeStamp, $text) = @{$annotation};          my ($timeStamp, $text, $user) = @{$annotation};
1183          # Check to see if this is a functional assignment.          # Check to see if this is a functional assignment.
1184          my ($user, $function) = _ParseAssignment($text);          my ($actualUser, $function) = _ParseAssignment($user, $text);
1185          if ($user && ! exists $timeHash{$user}) {          if ($actualUser && ! exists $retVal{$actualUser}) {
1186              # Here it is a functional assignment and there has been no              # Here it is a functional assignment and there has been no
1187              # previous assignment for this user, so we stuff it in the              # previous assignment for this user, so we stuff it in the
1188              # return hash.              # return hash.
1189              $retVal{$function} = $user;              $retVal{$actualUser} = $function;
             # Insure we don't assign to this user again.  
             $timeHash{$user} = 1;  
1190          }          }
1191      }      }
1192      # Return the hash of assignments found.      # Return the hash of assignments found.
# Line 1138  Line 1202 
1202  The functional assignment is handled differently depending on the type of feature. If  The functional assignment is handled differently depending on the type of feature. If
1203  the feature is identified by a FIG ID (begins with the string C<fig|>), then a functional  the feature is identified by a FIG ID (begins with the string C<fig|>), then a functional
1204  assignment is a type of annotation. The format of an assignment is described in  assignment is a type of annotation. The format of an assignment is described in
1205  L</ParseLocation>. Its worth noting that we cannot filter on the content of the  L</ParseAssignment>. Its worth noting that we cannot filter on the content of the
1206  annotation itself because it's a text field; however, this is not a big problem because  annotation itself because it's a text field; however, this is not a big problem because
1207  most features only have a small number of annotations.  most features only have a small number of annotations.
1208    
# Line 1200  Line 1264 
1264              }              }
1265          }          }
1266          # Build a query for all of the feature's annotations, sorted by date.          # Build a query for all of the feature's annotations, sorted by date.
1267          my $query = $self->Get(['IsTargetOfAnnotation', 'Annotation'],          my $query = $self->Get(['IsTargetOfAnnotation', 'Annotation', 'MadeAnnotation'],
1268                                 "IsTargetOfAnnotation(from-link) = ? ORDER BY Annotation(time) DESC",                                 "IsTargetOfAnnotation(from-link) = ? ORDER BY Annotation(time) DESC",
1269                                 [$featureID]);                                 [$featureID]);
1270          my $timeSelected = 0;          my $timeSelected = 0;
1271          # Loop until we run out of annotations.          # Loop until we run out of annotations.
1272          while (my $annotation = $query->Fetch()) {          while (my $annotation = $query->Fetch()) {
1273              # Get the annotation text.              # Get the annotation text.
1274              my ($text, $time) = $annotation->Values(['Annotation(annotation)','Annotation(time)']);              my ($text, $time, $user) = $annotation->Values(['Annotation(annotation)',
1275                                                         'Annotation(time)', 'MadeAnnotation(from-link)']);
1276              # Check to see if this is a functional assignment for a trusted user.              # Check to see if this is a functional assignment for a trusted user.
1277              my ($user, $function) = _ParseAssignment($text);              my ($actualUser, $function) = _ParseAssignment($user, $text);
1278              if ($user) {              Trace("Assignment user is $actualUser, text is $function.") if T(4);
1279                if ($actualUser) {
1280                  # Here it is a functional assignment. Check the time and the user                  # Here it is a functional assignment. Check the time and the user
1281                  # name. The time must be recent and the user must be trusted.                  # name. The time must be recent and the user must be trusted.
1282                  if ((exists $trusteeTable{$user}) && ($time > $timeSelected)) {                  if ((exists $trusteeTable{$actualUser}) && ($time > $timeSelected)) {
1283                      $retVal = $function;                      $retVal = $function;
1284                      $timeSelected = $time;                      $timeSelected = $time;
1285                  }                  }
# Line 1229  Line 1295 
1295      return $retVal;      return $retVal;
1296  }  }
1297    
1298    =head3 FunctionsOf
1299    
1300    C<< my @functionList = $sprout->FunctionOf($featureID, $userID); >>
1301    
1302    Return the functional assignments of a particular feature.
1303    
1304    The functional assignment is handled differently depending on the type of feature. If
1305    the feature is identified by a FIG ID (begins with the string C<fig|>), then a functional
1306    assignment is a type of annotation. The format of an assignment is described in
1307    L</ParseAssignment>. Its worth noting that we cannot filter on the content of the
1308    annotation itself because it's a text field; however, this is not a big problem because
1309    most features only have a small number of annotations.
1310    
1311    If the feature is B<not> identified by a FIG ID, then the functional assignment
1312    information is taken from the B<ExternalAliasFunc> table. If the table does
1313    not contain an entry for the feature, an empty list is returned.
1314    
1315    =over 4
1316    
1317    =item featureID
1318    
1319    ID of the feature whose functional assignments are desired.
1320    
1321    =item RETURN
1322    
1323    Returns a list of 2-tuples, each consisting of a user ID and the text of an assignment by
1324    that user.
1325    
1326    =back
1327    
1328    =cut
1329    #: Return Type @@;
1330    sub FunctionsOf {
1331        # Get the parameters.
1332        my ($self, $featureID) = @_;
1333        # Declare the return value.
1334        my @retVal = ();
1335        # Determine the ID type.
1336        if ($featureID =~ m/^fig\|/) {
1337            # Here we have a FIG feature ID. We must build the list of trusted
1338            # users.
1339            my %trusteeTable = ();
1340            # Build a query for all of the feature's annotations, sorted by date.
1341            my $query = $self->Get(['IsTargetOfAnnotation', 'Annotation', 'MadeAnnotation'],
1342                                   "IsTargetOfAnnotation(from-link) = ? ORDER BY Annotation(time) DESC",
1343                                   [$featureID]);
1344            my $timeSelected = 0;
1345            # Loop until we run out of annotations.
1346            while (my $annotation = $query->Fetch()) {
1347                # Get the annotation text.
1348                my ($text, $time, $user) = $annotation->Values(['Annotation(annotation)',
1349                                                                'Annotation(time)',
1350                                                                'MadeAnnotation(user)']);
1351                # Check to see if this is a functional assignment for a trusted user.
1352                my ($actualUser, $function) = _ParseAssignment($user, $text);
1353                if ($actualUser) {
1354                    # Here it is a functional assignment.
1355                    push @retVal, [$actualUser, $function];
1356                }
1357            }
1358        } else {
1359            # Here we have a non-FIG feature ID. In this case the user ID does not
1360            # matter. We simply get the information from the External Alias Function
1361            # table.
1362            my @assignments = $self->GetEntityValues('ExternalAliasFunc', $featureID,
1363                                                     ['ExternalAliasFunc(func)']);
1364            push @retVal, map { ['master', $_] } @assignments;
1365        }
1366        # Return the assignments found.
1367        return @retVal;
1368    }
1369    
1370  =head3 BBHList  =head3 BBHList
1371    
1372  C<< my $bbhHash = $sprout->BBHList($genomeID, \@featureList); >>  C<< my $bbhHash = $sprout->BBHList($genomeID, \@featureList); >>
# Line 1266  Line 1404 
1404          my $query = $self->Get(['IsBidirectionalBestHitOf'],          my $query = $self->Get(['IsBidirectionalBestHitOf'],
1405                                 "IsBidirectionalBestHitOf(from-link) = ? AND IsBidirectionalBestHitOf(genome) = ?",                                 "IsBidirectionalBestHitOf(from-link) = ? AND IsBidirectionalBestHitOf(genome) = ?",
1406                                 [$featureID, $genomeID]);                                 [$featureID, $genomeID]);
1407          # Look for the best hit.          # Peel off the BBHs found.
1408          my $bbh = $query->Fetch;          my @found = ();
1409          if ($bbh) {          while (my $bbh = $query->Fetch) {
1410              my ($targetFeature) = $bbh->Value('IsBidirectionalBestHitOf(to-link)');              push @found, $bbh->Value('IsBidirectionalBestHitOf(to-link)');
             $retVal{$featureID} = $targetFeature;  
1411          }          }
1412            $retVal{$featureID} = \@found;
1413      }      }
1414      # Return the mapping.      # Return the mapping.
1415      return \%retVal;      return \%retVal;
# Line 1349  Line 1487 
1487      my $genomeData = $self->GetEntity('Genome', $genomeID);      my $genomeData = $self->GetEntity('Genome', $genomeID);
1488      if ($genomeData) {      if ($genomeData) {
1489          # The genome exists, so get the completeness flag.          # The genome exists, so get the completeness flag.
1490          ($retVal) = $genomeData->Value('complete');          ($retVal) = $genomeData->Value('Genome(complete)');
1491      }      }
1492      # Return the result.      # Return the result.
1493      return $retVal;      return $retVal;
# Line 2547  Line 2685 
2685                                      ['HasSSCell(from-link)', 'IsRoleOf(from-link)']);                                      ['HasSSCell(from-link)', 'IsRoleOf(from-link)']);
2686      # Create the return value.      # Create the return value.
2687      my %retVal = ();      my %retVal = ();
2688        # Build a hash to weed out duplicates. Sometimes the same PEG and role appears
2689        # in two spreadsheet cells.
2690        my %dupHash = ();
2691      # Loop through the results, adding them to the hash.      # Loop through the results, adding them to the hash.
2692      for my $record (@subsystems) {      for my $record (@subsystems) {
2693            # Get this subsystem and role.
2694          my ($subsys, $role) = @{$record};          my ($subsys, $role) = @{$record};
2695          if (exists $retVal{$subsys}) {          # Insure it's the first time for both.
2696            my $dupKey = "$subsys\n$role";
2697            if (! exists $dupHash{"$subsys\n$role"}) {
2698                $dupHash{$dupKey} = 1;
2699              push @{$retVal{$subsys}}, $role;              push @{$retVal{$subsys}}, $role;
         } else {  
             $retVal{$subsys} = [$role];  
2700          }          }
2701      }      }
2702      # Return the hash.      # Return the hash.
# Line 3083  Line 3226 
3226      return $retVal;      return $retVal;
3227  }  }
3228    
3229    =head3 DeleteGenome
3230    
3231    C<< my $stats = $sprout->DeleteGenome($genomeID, $testFlag); >>
3232    
3233    Delete a genome from the database.
3234    
3235    =over 4
3236    
3237    =item genomeID
3238    
3239    ID of the genome to delete
3240    
3241    =item testFlag
3242    
3243    If TRUE, then the DELETE statements will be traced, but no deletions will occur.
3244    
3245    =item RETURN
3246    
3247    Returns a statistics object describing the rows deleted.
3248    
3249    =back
3250    
3251    =cut
3252    #: Return Type $%;
3253    sub DeleteGenome {
3254        # Get the parameters.
3255        my ($self, $genomeID, $testFlag) = @_;
3256        # Perform the delete for the genome's features.
3257        my $retVal = $self->{_erdb}->Delete('Feature', "fig|$genomeID.%", $testFlag);
3258        # Perform the delete for the primary genome data.
3259        my $stats = $self->{_erdb}->Delete('Genome', $genomeID, $testFlag);
3260        $retVal->Accumulate($stats);
3261        # Return the result.
3262        return $retVal;
3263    }
3264    
3265  =head2 Internal Utility Methods  =head2 Internal Utility Methods
3266    
3267  =head3 ParseAssignment  =head3 ParseAssignment
# Line 3093  Line 3272 
3272    
3273  A functional assignment is always of the form  A functional assignment is always of the form
3274    
3275      I<XXXX>C<\nset >I<YYYY>C< function to\n>I<ZZZZZ>      C<set >I<YYYY>C< function to\n>I<ZZZZZ>
3276    
3277  where I<XXXX> is the B<assigning user>, I<YYYY> is the B<user>, and I<ZZZZ> is the  where I<YYYY> is the B<user>, and I<ZZZZ> is the actual functional role. In most cases,
3278  actual functional role. In most cases, the user and the assigning user will be the  the user and the assigning user (from MadeAnnotation) will be the same, but that is
3279  same, but that is not always the case.  not always the case.
3280    
3281    In addition, the functional role may contain extra data that is stripped, such as
3282    terminating spaces or a comment separated from the rest of the text by a tab.
3283    
3284  This is a static method.  This is a static method.
3285    
3286  =over 4  =over 4
3287    
3288    =item user
3289    
3290    Name of the assigning user.
3291    
3292  =item text  =item text
3293    
3294  Text of the annotation.  Text of the annotation.
# Line 3118  Line 3304 
3304    
3305  sub _ParseAssignment {  sub _ParseAssignment {
3306      # Get the parameters.      # Get the parameters.
3307      my ($text) = @_;      my ($user, $text) = @_;
3308      # Declare the return value.      # Declare the return value.
3309      my @retVal = ();      my @retVal = ();
3310      # Check to see if this is a functional assignment.      # Check to see if this is a functional assignment.
3311      my ($user, $type, $function) = split(/\n/, $text);      my ($type, $function) = split(/\n/, $text);
3312      if ($type =~ m/^set ([^ ]+) function to$/i) {      if ($type =~ m/^set function to$/i) {
3313          # Here it is, so we return the user name (which is in $1), the functional role text,          # Here we have an assignment without a user, so we use the incoming user ID.
3314          # and the assigning user.          @retVal = ($user, $function);
3315          @retVal = ($1, $function, $user);      } elsif ($type =~ m/^set (\S+) function to$/i) {
3316            # Here we have an assignment with a user that is passed back to the caller.
3317            @retVal = ($1, $function);
3318        }
3319        # If we have an assignment, we need to clean the function text. There may be
3320        # extra junk at the end added as a note from the user.
3321        if (@retVal) {
3322            $retVal[1] =~ s/(\t\S)?\s*$//;
3323      }      }
3324      # Return the result list.      # Return the result list.
3325      return @retVal;      return @retVal;
# Line 3154  Line 3347 
3347    
3348  sub FriendlyTimestamp {  sub FriendlyTimestamp {
3349      my ($timeValue) = @_;      my ($timeValue) = @_;
3350      my $retVal = strftime("%a %b %e %H:%M:%S %Y", localtime($timeValue));      my $retVal = localtime($timeValue);
3351      return $retVal;      return $retVal;
3352  }  }
3353    
# Line 3216  Line 3409 
3409  }  }
3410    
3411    
   
3412  1;  1;

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.55

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3