Ignore:
Timestamp:
Oct 29, 2009 12:28:47 AM (10 years ago)
Author:
jwatson
Message:

Updates to allow for proper handling of variable maps in cases where formats cannot handle fully qualified,
human-readable variable names. Many ripple effects, as problem writers now must return a variable map (or None,
if not applicable. CBC now properly handles and reads NL and SOL input/output combinations!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/coopr/opt/solver/shellcmd.py

    r1768 r1772  
    1313import sys
    1414import os
     15from coopr.opt.base import *
     16from coopr.opt.base.solver import *
     17import tempfile
     18
    1519import pyutilib.common
    1620import pyutilib.services
     
    1822import pyutilib.plugin.core
    1923import pyutilib.misc
    20 from coopr.opt.base import *
    21 from coopr.opt.base.solver import *
    22 import tempfile
    23 
    2424
    2525class SystemCallSolver(OptSolver):
     
    130130
    131131    def _postsolve(self):
     132
    132133        if self.log_file is not None:
    133134           OUTPUT=open(self.log_file,"w")
     
    150151           if not self.keepFiles:
    151152              pyutilib.services.TempfileManager.clear_tempfiles()
     153              # in some cases, the solution filename is not generated via the temp-file mechanism,
     154              # instead being automatically derived from the input lp/nl filename. so, we may
     155              # have to clean it up manually.
     156              if os.path.exists(self.soln_file):
     157                 os.remove(self.soln_file)
    152158
    153159        return results
     
    160166            [rc, log] = pyutilib.subprocess.run(command.cmd, timelimit=self._timelimit, env=command.env, tee=self.tee, shell=True)
    161167        except pyutilib.common.WindowsError, err:
    162             raise pyutilib.Acommon.pplicationError, "Could not execute the command: "+command.cmd+"\tError message: "+str(err)
     168            raise pyutilib.common.ApplicationError, "Could not execute the command: "+command.cmd+"\tError message: "+str(err)
    163169        sys.stdout.flush()
    164170        return [rc,log]
Note: See TracChangeset for help on using the changeset viewer.