Ignore:
Timestamp:
11/16/09 14:07:15 (4 years ago)
Author:
wehart
Message:

Use the coopr.opt guess_format function().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/base/PyomoModel.py

    r1794 r1898  
    2020from pyutilib.misc import quote_split, tuplize 
    2121 
    22 from coopr.opt import ProblemFormat, ResultsFormat 
     22from coopr.opt import ProblemFormat, ResultsFormat, guess_format 
    2323from coopr.pyomo.base.var import _VarValue 
    2424import coopr.opt 
     
    317317            # Guess the format 
    318318            # 
    319             for fmt in coopr.opt.ProblemFormat: 
    320                 if filename.endswith('.'+str(fmt)): 
    321                     format=fmt 
    322                     break 
     319            format = guess_format(filename) 
    323320        problem_writer = coopr.opt.WriterFactory(format) 
    324321        if problem_writer is None: 
Note: See TracChangeset for help on using the changeset viewer.