Changeset 4984


Ignore:
Timestamp:
09/30/11 16:15:26 (3 years ago)
Author:
wehart
Message:

Adding option to force output of results in json format.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/scripting/pyomo.py

    r4940 r4984  
    204204        dest='show_results', 
    205205        default=False) 
     206    group.add_argument('--json', 
     207        help='Print results in JSON format.  The default is YAML, if the PyYAML utility is available', 
     208        action='store_true', 
     209        dest='json', 
     210        default=False) 
    206211    group.add_argument('-s','--summary', 
    207212        help='Summarize the final solution after performing optimization.', 
     
    345350 
    346351def main(args=None): 
    347     run(args) 
    348     #import pyutilib.component.core 
    349     #pyutilib.component.core.PluginGlobals.pprint() 
     352    ans = run(args) 
     353    if ans is None: 
     354        return 0 
     355    return 1 
     356 
Note: See TracChangeset for help on using the changeset viewer.