Changeset 2262


Ignore:
Timestamp:
Feb 4, 2010 11:54:50 PM (10 years ago)
Author:
jwatson
Message:

Minor improvement to phinit functionality.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pysp/trunk/coopr/pysp/phinit.py

    r2261 r2262  
    4141#
    4242
    43 def construct_ph_options_parser():
     43def construct_ph_options_parser(usage_string):
    4444
    4545   parser = OptionParser()
     
    277277                     default=True)
    278278
    279    parser.usage="runph [options]"
     279   parser.usage=usage_string
    280280
    281281   return parser
     
    302302         print ""
    303303         print "***ERROR: Exiting test driver: No 'model' object created in module "+reference_model_filename
    304          return
     304         return None, None, None
    305305
    306306      if model_import.model is None:
    307307         print ""
    308308         print "***ERROR: Exiting test driver: 'model' object equals 'None' in module "+reference_model_filename
    309          return
     309         return None, None, None
    310310 
    311311      reference_model = model_import.model
    312312   except IOError:
    313313      print "***ERROR: Failed to load scenario reference model from file="+reference_model_filename
    314       return
     314      return None, None, None
    315315
    316316   try:
     
    321321   except IOError:
    322322      print "***ERROR: Failed to load scenario reference instance data from file="+reference_instance_filename
    323       return      
     323      return None, None, None
    324324
    325325   #
     
    337337   except IOError:
    338338      print "***ERROR: Failed to load scenario tree reference instance data from file="+scenario_tree_instance_filename
    339       return
     339      return None, None, None
    340340   
    341341   #
     
    589589
    590590      reference_model, reference_instance, scenario_tree = load_reference_and_scenario_models(options)
     591      if reference_model is None or reference_instance is None or scenario_tree is None:
     592         return
    591593      ph = create_ph_from_scratch(options, reference_model, reference_instance, scenario_tree)
    592594
     
    608610    #
    609611    try:
    610        ph_options_parser = construct_ph_options_parser()
     612       ph_options_parser = construct_ph_options_parser("runph [options]")
    611613       (options, args) = ph_options_parser.parse_args(args=args)
    612614    except SystemExit:
Note: See TracChangeset for help on using the changeset viewer.