Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
7bdd4a67
Commit
7bdd4a67
authored
Jan 14, 2015
by
peastman
Browse files
Merge pull request #780 from rmcgibbo/win32
Some windows changes
parents
bfdae096
d0509247
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
34 deletions
+12
-34
wrappers/python/simtk/openmm/__init__.py
wrappers/python/simtk/openmm/__init__.py
+12
-1
wrappers/python/src/swig_doxygen/swig_lib/python/typemaps.i
wrappers/python/src/swig_doxygen/swig_lib/python/typemaps.i
+0
-33
No files found.
wrappers/python/simtk/openmm/__init__.py
View file @
7bdd4a67
...
...
@@ -10,11 +10,22 @@ It also tries to load any plugin modules it can find.
__author__
=
"Randall J. Radmer"
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.vec3
import
Vec3
from
simtk.openmm
import
version
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'
))
else
:
pluginLoadedLibNames
=
Platform
.
loadPluginsFromDirectory
(
Platform
.
getDefaultPluginsDirectory
())
if
sys
.
platform
==
'win32'
:
os
.
environ
[
'PATH'
]
=
_path
del
_path
__version__
=
Platform
.
getOpenMMVersion
()
wrappers/python/src/swig_doxygen/swig_lib/python/typemaps.i
View file @
7bdd4a67
...
...
@@ -168,36 +168,3 @@
// createCheckpoint returns a bytes object
$
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
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment