[Bio] / Sprout / LoadSproutTables.pl Repository:
ViewVC logotype

Diff of /Sprout/LoadSproutTables.pl

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

revision 1.30, Mon Jun 5 05:51:51 2006 UTC revision 1.34, Sat Jul 1 03:49:19 2006 UTC
# Line 262  Line 262 
262  Loads B<ReactionURL>, B<Compound>, B<CompoundName>,  Loads B<ReactionURL>, B<Compound>, B<CompoundName>,
263  B<CompoundCAS>, B<IsAComponentOf>, B<Reaction>.  B<CompoundCAS>, B<IsAComponentOf>, B<Reaction>.
264    
265    =item Synonym
266    
267    Loads B<SynonymGroup> and B<IsSynonymGroupFor>.
268    
269  =item *  =item *
270    
271  Loads all of the above tables.  Loads all of the above tables.
# Line 324  Line 328 
328    
329  Trace SQL statements.  Trace SQL statements.
330    
331    =item phone
332    
333    Phone number to message when the load finishes.
334    
335  =back  =back
336    
337  =cut  =cut
# Line 350  Line 358 
358                                                loadOnly => [0, "load the database from previously generated files"],                                                loadOnly => [0, "load the database from previously generated files"],
359                                                primaryOnly => [0, "only process the group's main entity"],                                                primaryOnly => [0, "only process the group's main entity"],
360                                                resume => [0, "resume a complete load starting with the first group specified in the parameter list"],                                                resume => [0, "resume a complete load starting with the first group specified in the parameter list"],
361                                                  phone => ["", "phone number (international format) to call when load finishes"],
362                                              },                                              },
363                                              "<group1> <group2> ...",                                              "<group1> <group2> ...",
364                                              @ARGV);                                              @ARGV);
# Line 374  Line 383 
383  if ($resume && @parameters > 1) {  if ($resume && @parameters > 1) {
384      Confess("If resume=1, only one load group can be specified.");      Confess("If resume=1, only one load group can be specified.");
385  } elsif (! @parameters) {  } elsif (! @parameters) {
386      Confess("No load groups were specified.");      Trace("No load groups were specified.") if T(0);
387  }  }
388    # Set a variable to contain return type information.
389    my $rtype;
390    # Insure we catch errors.
391    eval {
392  # Process the parameters.  # Process the parameters.
393  for my $group (@parameters) {  for my $group (@parameters) {
394      Trace("Processing load group $group.") if T(2);      Trace("Processing load group $group.") if T(2);
# Line 424  Line 437 
437          $spl->LoadReactionData();          $spl->LoadReactionData();
438          $group = ResumeCheck($resume, $group);          $group = ResumeCheck($resume, $group);
439      }      }
440            if ($group eq 'Synonym' || $group eq '*') {
441                $spl->LoadSynonymData();
442                $group = ResumeCheck($resume, $group);
443  }  }
444        }
445    };
446    if ($@) {
447        Trace("Load failed with error: $@") if T(0);
448        $rtype = "error";
449    } else {
450  Trace("Load complete.") if T(2);  Trace("Load complete.") if T(2);
451        $rtype = "no error";
452    }
453    if ($options->{phone}) {
454        my $msgID = Tracer::SendSMS($options->{phone}, "Sprout load terminated with $rtype.");
455        if ($msgID) {
456            Trace("Phone message sent with ID $msgID.") if T(2);
457        } else {
458            Trace("Phone message not sent.") if T(2);
459        }
460    }
461  # If the resume flag is set, return "*", else return "".  # If the resume flag is set, return "*", else return "".
462  sub ResumeCheck {  sub ResumeCheck {
463      my ($resume, $group) = @_;      my ($resume, $group) = @_;

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.34

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3