Commit 570440d8 authored by bonnell's avatar bonnell

fix 'import visit' from installed python on Windows

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@19880 18c085ea-50e0-402c-830e-de6fd14e8384
parent 83dd0ed5
......@@ -281,6 +281,9 @@ static bool EndsWith(const char *s, const char *suffix)
* Removed 'TestForConfigFIles' and attendent methods. Remove version #
* from VISITUSERHOME path.
*
* Kathleen Biagas, Wed Dec 19 17:35:21 MST 2012
* Return '0' instead of '1' when only printing environment.
*
*****************************************************************************/
int
......@@ -562,7 +565,7 @@ VisItLauncherMain(int argc, char *argv[])
{
PrintEnvironment();
componentArgs.clear();
return 1;
return 0;
}
stringVector command;
......
......@@ -42,6 +42,7 @@ list of changes in release 2.6.</p>
<li>A bug was corrected with the Xdmf reader where it would incorrectly report that vector variables defined on multi block meshes were invalid.</li>
<li>The Xdmf reader was enhanced so that it supports reading the BaseIndex and GhostOffsets properties for structured grids.</li>
<li>A bug caused by an indexing error was corrected in depth cueing. Thanks Jean Favre for the fix.</li>
<li>'import visit' from an installed python on Windows is again operational.</li>
</ul>
<p><b><font size="4">Enhancements in version 2.6.1</font></b></p>
......
......@@ -52,6 +52,12 @@
# Brad Whitlock, Thu Jul 26 15:05:16 PDT 2012
# Make "from visit import *" add the VisIt functions to the main namespace
# as was intended.
#
# Kathleen Biagas, Wed Dec 19 17:22:44 MST 2012
# Explicitly load shared library dependencies on Windows, too (though this
# mainly seems to be needed from a dev version, not an installed version.)
# Use 'splitlines' instead of split("\n"), use list version of first
# argmument for Popen command, so that it works on Windows.
#
###############################################################################
......@@ -170,6 +176,18 @@ class VisItModuleState(object):
for lib in libs:
libfile = pjoin(libdir,lib + ext)
a = ctypes.cdll.LoadLibrary(libfile)
elif sys.platform.startswith("win"):
import ctypes
site_pkg = os.path.split(mod_path)[0]
libdir = os.path.split(site_pkg)[0]
libdir = pjoin(libdir, "..\\")
libdir = os.path.abspath(libdir)
ext = ".dll"
libs = ("visitcommon","avtdbatts","viewerrpc","viewerproxy","visitpy")
for lib in libs:
libfile = pjoin(libdir,lib + ext)
a = ctypes.cdll.LoadLibrary(libfile)
res = None
try:
res = imp.load_module("visit", mfile, mpath, mdes)
......@@ -215,8 +233,8 @@ class VisItModuleState(object):
raise Exception(msg)
@classmethod
def __read_visit_env(cls,vcmd):
vcmd += " -env"
p = subprocess.Popen(vcmd,
pcmd = [vcmd, "-env"]
p = subprocess.Popen(pcmd,
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
......@@ -225,7 +243,7 @@ class VisItModuleState(object):
msg = "Could not execute VisIt to determine proper env settings!\n"
msg += "Is VisIt in your shell's PATH?"
raise Exception(msg)
pout = pout.split("\n")
pout = pout.splitlines()
# we want to know LIBPATH, and VISITPLUGINDIR
res = {"LIBPATH":"",
"VISITPLUGINDIR":"",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment