"plugins/cpupme/vscode:/vscode.git/clone" did not exist on "b2d2412120a5b054613e7138d2b27426d831c31e"
Commit 2f42ac0a authored by Robert T. McGibbon's avatar Robert T. McGibbon
Browse files

Some windows changes

parent bfdae096
...@@ -10,11 +10,22 @@ It also tries to load any plugin modules it can find. ...@@ -10,11 +10,22 @@ It also tries to load any plugin modules it can find.
__author__ = "Randall J. Radmer" __author__ = "Randall J. Radmer"
import os, os.path import os, os.path
import sys
from simtk.openmm import version
if sys.platform == 'win32':
_path = os.environ['PATH']
os.environ['PATH'] = '%(lib)s;%(lib)s\plugins' % {'lib': version.openmm_library_path}
from simtk.openmm.openmm import * from simtk.openmm.openmm import *
from simtk.openmm.vec3 import Vec3 from simtk.openmm.vec3 import Vec3
from simtk.openmm import version
if os.getenv('OPENMM_PLUGIN_DIR') is None and os.path.isdir(version.openmm_library_path): if os.getenv('OPENMM_PLUGIN_DIR') is None and os.path.isdir(version.openmm_library_path):
pluginLoadedLibNames = Platform.loadPluginsFromDirectory(os.path.join(version.openmm_library_path, 'plugins')) pluginLoadedLibNames = Platform.loadPluginsFromDirectory(os.path.join(version.openmm_library_path, 'plugins'))
else: else:
pluginLoadedLibNames = Platform.loadPluginsFromDirectory(Platform.getDefaultPluginsDirectory()) pluginLoadedLibNames = Platform.loadPluginsFromDirectory(Platform.getDefaultPluginsDirectory())
if sys.platform == 'win32':
os.environ['PATH'] = _path
del _path
__version__ = Platform.getOpenMMVersion() __version__ = Platform.getOpenMMVersion()
...@@ -168,36 +168,3 @@ ...@@ -168,36 +168,3 @@
// createCheckpoint returns a bytes object // createCheckpoint returns a bytes object
$result = PyBytes_FromStringAndSize($1.c_str(), $1.length()); $result = PyBytes_FromStringAndSize($1.c_str(), $1.length());
} }
%typemap(in) const std::string & (std::string temp2) {
// if we have a C++ method that takes in a std::string, we're most happy to
// accept a python bytes object. But if the user passes in a unicode object
// we'll try to recover by encoding it to UTF-8 bytes
PyObject* temp = NULL;
char* c_str = NULL;
Py_ssize_t len = 0;
if (PyUnicode_Check($input)) {
temp = PyUnicode_AsUTF8String($input);
if (temp == NULL) {
SWIG_exception_fail(SWIG_TypeError, "$symname: 'utf-8' codec can't decode byte");
}
PyBytes_AsStringAndSize(temp, &c_str, &len);
Py_XDECREF(temp);
} else if (PyBytes_Check($input)) {
PyBytes_AsStringAndSize($input, &c_str, &len);
} else {
SWIG_exception_fail(SWIG_TypeError, "$symname: argument must be str or bytes");
}
if (c_str == NULL) {
SWIG_exception_fail(SWIG_TypeError, "$symname: argument must be str or bytes");
}
temp2 = std::string(c_str, len);
$1 = &temp2;
}
%typemap(freearg) const std::string & {
// pass
}
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