Changeset 2985


Ignore:
Timestamp:
Aug 30, 2010 10:17:53 PM (9 years ago)
Author:
wehart
Message:

Adding logic to disable cplexdirect plugins if
cplex cannot be imported.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.plugins/trunk/coopr/plugins/mip/CPLEXDirect.py

    r2984 r2985  
    148148       # TBD
    149149       cplex_instance = None
    150        if not cplex_import_available:
    151           raise ValueError, "Cannot import 'cplex'\nFAILED TO CREATE CPLEX INSTANCE!"
    152150       try:
    153151          cplex_instance = cplex.Cplex()
     
    768766    """
    769767
    770     pyutilib.component.core.alias('_mock_cplex')
     768    pyutilib.component.core.alias('_mock_cplexdirect')
    771769
    772770    def __init__(self, **kwds):
     
    792790
    793791
    794 pyutilib.services.register_executable(name="cplexdirect")
     792if cplex_import_available:
     793    OptSolverFactory().deactivate('cplexdirect')
     794    OptSolverFactory().deactivate('_mock_cplexdirect')
     795
Note: See TracChangeset for help on using the changeset viewer.