Changeset 3090


Ignore:
Timestamp:
Oct 13, 2010 1:58:07 PM (10 years ago)
Author:
khunter
Message:

Fix for Windows quoting and playing nice with backslashes in paths.

File:
1 edited

Legend:

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

    r3087 r3090  
    115115        gurobi_script_file.write("sys.path.append("+"\""+os.path.dirname(__file__)+"\""+")\n")
    116116        gurobi_script_file.write("from GUROBI_RUN import *\n")
     117        problem_filename = self._problem_files[0]
     118        solution_filename = self.soln_file
    117119        if sys.platform == 'win32':
    118            problem_filename = "\'"+string.replace(self._problem_files[0], "\\", "\\\\")+"\'"
    119            solution_filename = "\'"+string.replace(self.soln_file, "\\", "\\\\")+"\'"
    120         else:
    121            problem_filename = self._problem_files[0]
    122            solution_filename = self.soln_file
     120           problem_filename  = problem_filename.replace('\\', r'\\')
     121           solution_filename = solution_filename.replace('\\', r'\\')
     122
    123123        gurobi_script_file.write("gurobi_run%s\n" % str((problem_filename, solution_filename)))
    124124        gurobi_script_file.write("quit()\n")
Note: See TracChangeset for help on using the changeset viewer.