Commit 954ddf92 authored by Berk Onat's avatar Berk Onat
Browse files

OpenMolfile Class is added with trajectory and topology functions

parent 59b6b410
from __future__ import absolute_import
from __future__ import print_function
import os
import re
import sys
import numpy as np
import warnings
if sys.version_info > (3,):
long = int
try:
from .molfile import libpymolfile
except ImportError:
warnings.warn("libpymolfile package not available, pymolfile does not work without its library!")
def plugins():
""" Information on the available molfile plugins
Example tuple: ('psf', 'psf', 1, 1, 1, 0, 1, 1, 1, 0,
'CHARMM,NAMD,XPLOR PSF', 'mol file reader',
'Justin Gullingsrud, John Stone', 1, 9, 17, 1)
The fields in the tuple represent info in ordered as follows:
1: format extension
2: format name
3: read_structure is avaliable if 1
4: read_bonds is avaliable if 1
5: read_angles is avaliable if 1
6: read_next_timestep is avaliable if 1
7: write_structure is avaliable if 1
8: write_bonds is avaliable if 1
9: write_angles is avaliable if 1
10: write_timestep is avaliable if 1
11: long name of the plugin
12: type of plugin
13: authors of the plugin
14: major version of the plugin
15: minor version of the plugin
16: ABI version of the plugin
17: 1 if is reentrant (returns is_reentrant)
Returns: A list of tuples that includes the information and
capabilities of each molfile plugin. The information is
extracted from molfile_plugin_t.
"""
max_num_plugins = 200
c_list = libpymolfile.molfile_plugin_list(max_num_plugins)
numlist = libpymolfile.molfile_init()
plugins_list = [libpymolfile.molfile_plugin_info(c_list, i) for i in range(numlist)]
libpymolfile.molfile_finish()
return plugins_list
def open(file_name_with_path, topology=None,
file_format=None, topology_format=None,
plugin=None, topology_plugin=None):
""" The main function to read topology and
trajectory files
Returns: Depends on the file format and arguments:
If structure file is supplied, it returns topology class.
If only trajectory file is supplied, it returns trajectory class
without topology information. (the number of atoms must be known)
If both files are supplied, it returns trajectory class with
topology information.
"""
pass
def get_dir_base_extension(file_name):
""" Splits directory, file base and file extensions
Returns: directory without leading '/',
file base name, and file extension without '.'
"""
file_base, file_extension_with_dot = os.path.splitext(os.path.basename(file_name))
file_extension = file_extension_with_dot.split(".")[-1]
file_dir = os.path.dirname(file_name)
return file_dir, file_base, file_extension
def get_extension(file_name):
""" Gets file extension of a file
Returns: file extension without '.'
"""
file_extension_with_dot = os.path.splitext(os.path.basename(file_name))[1]
return file_extension_with_dot.split(".")[-1]
def get_plugin_with_ext(file_ext):
""" Search molfile plugins list and returns the plugin info
for the first matched extension.
Returns: Plugin no in the list and the list item (the plugin info tuple)
"""
if not MOLFILE_PLUGINS:
MOLFILE_PLUGINS = plugins()
if MOLFILE_PLUGINS:
plugin_no = -1
for plugin_info in MOLFILE_PLUGINS:
plugin_no += 1
if file_ext == plugin_info[1]:
return (plugin_no, plugin_info)
return None
def get_plugin_with_name(plugin_name):
""" Search molfile plugins list and returns the plugin info
for the first matching name in plugin name field.
Returns: Plugin no in the list and the list item (the plugin info tuple)
"""
if not MOLFILE_PLUGINS:
MOLFILE_PLUGINS = plugins()
if MOLFILE_PLUGINS:
plugin_no = -1
for plugin_info in MOLFILE_PLUGINS:
plugin_no += 1
if plugin_name == plugin_info[2]:
return (plugin_no, plugin_info)
return None
class OpenMolfile(object):
self.plugin_list = MOLFILE_PLUGINS
self.trajectory = None
self.topology = None
self.smolobject = None
self.cmolobject = None
self.kwords = {
"file_format" : None,
"file_plugin" : None,
"topology" : None,
"topology_format" : None,
"topology_plugin" : None,
"natoms" : None
}
def __init__(self, file_name, **kwargs):
if kwargs:
for k, v in kwargs.items():
if k in self.kwords:
self.kwords[k] = v
if file_name:
if self.kwords["file_format"] is None:
file_dir, file_base, file_ext = get_dir_base_extension(file_name)
if file_ext:
self.kwords["file_format"] = file_ext
else:
self.kwords["file_format"] = file_base
if self.kwords["file_plugin"] is None:
self.kwords["file_plugin"] = "auto"
if "auto" in self.kwords["file_plugin"]:
plugin_item = get_plugin_with_ext(self.kwords["file_format"])
self.kwords["file_plugin"] =
if self.kwords["file_plugin"]:
if not MOLFILE_PLUGINS:
MOLFILE_PLUGINS = plugins()
c_list = libpymolfile.molfile_plugin_list(max_num_plugins)
numlist = libpymolfile.molfile_init()
self.cmolobject = libpymolfile.get_plugin(MOLFILE_PLUGINS, 83) #trr
else:
return None
def get_listof_parts( filename, filepath, fileformats ):
pattern = re.escape( filename[1:-4] ) + "\.part[0-9]{4,4}\.(xtc|trr)$"
parts = []
for f in os.listdir( directory ):
m = re.match( pattern, f )
if m and os.path.isfile( os.path.join( directory, f ) ):
parts.append( os.path.join( directory, f ) )
return sorted( parts )
def get_trajectory( file_name ):
ext = os.path.splitext( file_name )[1].lower()
types = {
".xtc": XtcTrajectory,
".trr": TrrTrajectory,
".netcdf": NetcdfTrajectory,
".nc": NetcdfTrajectory,
".dcd": DcdTrajectory,
}
if ext in types:
return types[ ext ]( file_name )
else:
raise Exception( "extension '%s' not supported" % ext )
class Topology( object ):
self.structure = None
self.bonds = None
self.angles = None
def __init__( self, file_name ):
pass
class Trajectory( object ):
def __init__( self, file_name ):
pass
def update( self, force=False ):
pass
def _get_frame( self, index ):
pass
def get_frame( self, index, atom_indices=None ):
box, coords, time = self._get_frame( int( index ) )
if atom_indices:
coords = np.concatenate([
])
return {
"coords": coords
"velocities": coords
}
def get_frame_string( self, index, atom_indices=None ):
frame = self.get_frame( index, atom_indices=atom_indices )
return (
)
def __del__( self ):
pass
......@@ -5,5 +5,7 @@ from . import pymolfile
__all__ = [ "pymolfile" ]
MAX_NUM_PLUGINS = 200
C_MOLFILE_PLUGINS = libpymolfile.molfile_plugin_list(MAX_NUM_PLUGINS)
MOLFILE_PLUGINS = pymolfile.plugins()
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
swig -py3 -Wall -c++ -python libpymolfile.i
echo "'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'-._.-'"
g++-7 -fPIC -Wall -Wextra -shared -g -Wunused-function -Wunused-parameter \
-I/labEnv3/lib/python3.6/site-packages/numpy/core/include/ \
-I./include \
......
......@@ -30,9 +30,6 @@
#include <ctype.h>
#include <string.h>
#include <inttypes.h>
#include "molfile_plugin.h"
#include "libmolfile_plugin.h"
#include "vmdplugin.h"
#include "pymolfile.h"
%}
......@@ -57,7 +54,7 @@ import_array();
initialize and finalize molfile plugins
*/
%feature("autodoc", "0") molfile_plugin_list;
extern molfile_plugin_t** molfile_plugin_list(int maxsize);
extern PyObject* molfile_plugin_list(int maxsize);
%feature("autodoc", "0") molfile_init;
extern int molfile_init(void);
......@@ -66,16 +63,20 @@ extern int molfile_init(void);
extern int molfile_finish(void);
%feature("autodoc", "0") get_plugin;
extern molfile_plugin_t* get_plugin(molfile_plugin_t** plugin_list, int plugin_no);
extern PyObject* get_plugin(PyObject* molcapsule, int plug_no);
%feature("autodoc", "0") molfile_plugin_info;
extern PyObject * molfile_plugin_info(PyObject* molcapsule, int plugin_no);
/*
%exception molfile_plugin_info {
$action
if (PyErr_Occurred()) SWIG_fail;
}
%inline %{
PyObject * molfile_plugin_info(molfile_plugin_t** plugin_list, int plugin_no) {
PyObject * molfile_plugin_info(PyObject* molcapsule, int plugin_no) {
molfile_plugin_t *plugin;
molfile_plugin_t** plugin_list = (molfile_plugin_t**) PyMolfileCapsule_AsVoidPtr(molcapsule);
int *plugno = &plugin_no;
int has_readstructure = 0;
int has_readbonds = 0;
......@@ -87,12 +88,12 @@ PyObject * molfile_plugin_info(molfile_plugin_t** plugin_list, int plugin_no) {
int has_writetimestep = 0;
int plugin_list_size = sizeof(plugin_list) / sizeof(molfile_plugin_t**);
if (plugno==NULL || plugin_no<0){
PyErr_Format(PyExc_IOError, "[%d] Error: molfile plugin handle no should be given, be positive value and should not exceed the list length'%d'. You set '%d'", pluginNOINIT, plugin_list_size, plugin_no);
PyErr_Format(PyExc_IOError, "Error: molfile plugin handle no should be given, be positive value and should not exceed the list length'%d'. You set '%d'", plugin_list_size, plugin_no);
return 0;
}
plugin = plugin_list[plugin_no];
if(plugin==NULL || !plugin->open_file_read){
PyErr_Format(PyExc_IOError, "[%d] Error: molfile plugin '%d' is not initialized.", pluginNOINIT, plugin_no);
PyErr_Format(PyExc_IOError, "Error: molfile plugin '%d' is not initialized.", plugin_no);
return 0;
}
if (plugin->read_structure) has_readstructure = 1;
......@@ -124,6 +125,7 @@ PyObject * molfile_plugin_info(molfile_plugin_t** plugin_list, int plugin_no) {
return tuple;
}
%}
*/
%feature("autodoc", "0") my_open_file_read;
......@@ -133,11 +135,12 @@ PyObject * molfile_plugin_info(molfile_plugin_t** plugin_list, int plugin_no) {
if (PyErr_Occurred()) SWIG_fail;
}
%inline %{
PyObject * my_open_file_read(molfile_plugin_t* plugin, char* fname, char* ftype, int natoms) {
PyObject * my_open_file_read(PyObject* molcapsule, char* fname, char* ftype, int natoms) {
if (PyType_Ready(&MolObjectType) < 0)
return NULL;
PyTypeObject *type = &MolObjectType;
MolObject *plugin_c;
molfile_plugin_t* plugin = (molfile_plugin_t*) PyMolfileCapsule_AsVoidPtr(molcapsule);
plugin_c = (MolObject *)type->tp_alloc(type, 0);
plugin_c->plugin = plugin;
plugin_c->file_handle = plugin->open_file_read(fname, ftype, &natoms);
......@@ -159,7 +162,7 @@ PyObject * my_close_file_read(PyObject* molpack) {
void* file_handle;
int numatoms;
MolObject* plugin_handle = (MolObject*) molpack;
plugin = plugin_handle->plugin;
plugin = plugin_handle->plugin;
file_handle = plugin_handle->file_handle;
numatoms = plugin_handle->natoms;
plugin->close_file_read(file_handle);
......
......@@ -107,8 +107,8 @@ except __builtin__.Exception:
_newclass = 0
def molfile_plugin_list(maxsize: 'int') -> "molfile_plugin_t **":
"""molfile_plugin_list(maxsize) -> molfile_plugin_t **"""
def molfile_plugin_list(maxsize: 'int') -> "PyObject *":
"""molfile_plugin_list(maxsize) -> PyObject *"""
return _libpymolfile.molfile_plugin_list(maxsize)
def molfile_init() -> "int":
......@@ -119,17 +119,17 @@ def molfile_finish() -> "int":
"""molfile_finish() -> int"""
return _libpymolfile.molfile_finish()
def get_plugin(plugin_list: 'molfile_plugin_t **', plugin_no: 'int') -> "molfile_plugin_t *":
"""get_plugin(plugin_list, plugin_no) -> molfile_plugin_t *"""
return _libpymolfile.get_plugin(plugin_list, plugin_no)
def get_plugin(molcapsule: 'PyObject *', plug_no: 'int') -> "PyObject *":
"""get_plugin(molcapsule, plug_no) -> PyObject *"""
return _libpymolfile.get_plugin(molcapsule, plug_no)
def molfile_plugin_info(plugin_list: 'molfile_plugin_t **', plugin_no: 'int') -> "PyObject *":
"""molfile_plugin_info(plugin_list, plugin_no) -> PyObject *"""
return _libpymolfile.molfile_plugin_info(plugin_list, plugin_no)
def molfile_plugin_info(molcapsule: 'PyObject *', plugin_no: 'int') -> "PyObject *":
"""molfile_plugin_info(molcapsule, plugin_no) -> PyObject *"""
return _libpymolfile.molfile_plugin_info(molcapsule, plugin_no)
def open_file_read(plugin: 'molfile_plugin_t *', fname: 'char *', ftype: 'char *', natoms: 'int') -> "PyObject *":
"""open_file_read(plugin, fname, ftype, natoms) -> PyObject *"""
return _libpymolfile.open_file_read(plugin, fname, ftype, natoms)
def open_file_read(molcapsule: 'PyObject *', fname: 'char *', ftype: 'char *', natoms: 'int') -> "PyObject *":
"""open_file_read(molcapsule, fname, ftype, natoms) -> PyObject *"""
return _libpymolfile.open_file_read(molcapsule, fname, ftype, natoms)
def close_file_read(molpack: 'PyObject *') -> "PyObject *":
"""close_file_read(molpack) -> PyObject *"""
......
......@@ -3004,10 +3004,8 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
/* -------- TYPES TABLE (BEGIN) -------- */
#define SWIGTYPE_p_char swig_types[0]
#define SWIGTYPE_p_molfile_plugin_t swig_types[1]
#define SWIGTYPE_p_p_molfile_plugin_t swig_types[2]
static swig_type_info *swig_types[4];
static swig_module_info swig_module = {swig_types, 3, 0, 0, 0, 0};
static swig_type_info *swig_types[2];
static swig_module_info swig_module = {swig_types, 1, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
......@@ -3123,9 +3121,6 @@ namespace swig {
#include <ctype.h>
#include <string.h>
#include <inttypes.h>
#include "molfile_plugin.h"
#include "libmolfile_plugin.h"
#include "vmdplugin.h"
#include "pymolfile.h"
......@@ -3298,62 +3293,12 @@ SWIGINTERNINLINE PyObject*
}
PyObject * molfile_plugin_info(molfile_plugin_t** plugin_list, int plugin_no) {
molfile_plugin_t *plugin;
int *plugno = &plugin_no;
int has_readstructure = 0;
int has_readbonds = 0;
int has_readangles = 0;
int has_writestructure = 0;
int has_writebonds = 0;
int has_writeangles = 0;
int has_readnexttimestep = 0;
int has_writetimestep = 0;
int plugin_list_size = sizeof(plugin_list) / sizeof(molfile_plugin_t**);
if (plugno==NULL || plugin_no<0){
PyErr_Format(PyExc_IOError, "[%d] Error: molfile plugin handle no should be given, be positive value and should not exceed the list length'%d'. You set '%d'", pluginNOINIT, plugin_list_size, plugin_no);
return 0;
}
plugin = plugin_list[plugin_no];
if(plugin==NULL || !plugin->open_file_read){
PyErr_Format(PyExc_IOError, "[%d] Error: molfile plugin '%d' is not initialized.", pluginNOINIT, plugin_no);
return 0;
}
if (plugin->read_structure) has_readstructure = 1;
if (plugin->read_bonds) has_readbonds = 1;
if (plugin->read_angles) has_readangles = 1;
if (plugin->read_next_timestep) has_readnexttimestep = 1;
if (plugin->write_structure) has_writestructure = 1;
if (plugin->write_bonds) has_writebonds = 1;
if (plugin->write_angles) has_writeangles = 1;
if (plugin->write_timestep) has_writetimestep = 1;
PyObject *tuple = PyTuple_New(17);
PyTuple_SET_ITEM(tuple, 0, PyString_FromString(plugin->filename_extension));
PyTuple_SET_ITEM(tuple, 1, PyString_FromString(plugin->name));
PyTuple_SET_ITEM(tuple, 2, PyInt_FromLong((long)has_readstructure));
PyTuple_SET_ITEM(tuple, 3, PyInt_FromLong((long)has_readbonds));
PyTuple_SET_ITEM(tuple, 4, PyInt_FromLong((long)has_readangles));
PyTuple_SET_ITEM(tuple, 5, PyInt_FromLong((long)has_readnexttimestep));
PyTuple_SET_ITEM(tuple, 6, PyInt_FromLong((long)has_writestructure));
PyTuple_SET_ITEM(tuple, 7, PyInt_FromLong((long)has_writebonds));
PyTuple_SET_ITEM(tuple, 8, PyInt_FromLong((long)has_writeangles));
PyTuple_SET_ITEM(tuple, 9, PyInt_FromLong((long)has_writetimestep));
PyTuple_SET_ITEM(tuple, 10, PyString_FromString(plugin->prettyname));
PyTuple_SET_ITEM(tuple, 11, PyString_FromString(plugin->type));
PyTuple_SET_ITEM(tuple, 12, PyString_FromString(plugin->author));
PyTuple_SET_ITEM(tuple, 13, PyInt_FromLong((long)plugin->majorv));
PyTuple_SET_ITEM(tuple, 14, PyInt_FromLong((long)plugin->minorv));
PyTuple_SET_ITEM(tuple, 15, PyInt_FromLong((long)plugin->abiversion));
PyTuple_SET_ITEM(tuple, 16, PyInt_FromLong((long)plugin->is_reentrant));
return tuple;
}
PyObject * my_open_file_read(molfile_plugin_t* plugin, char* fname, char* ftype, int natoms) {
PyObject * my_open_file_read(PyObject* molcapsule, char* fname, char* ftype, int natoms) {
if (PyType_Ready(&MolObjectType) < 0)
return NULL;
PyTypeObject *type = &MolObjectType;
MolObject *plugin_c;
molfile_plugin_t* plugin = (molfile_plugin_t*) PyMolfileCapsule_AsVoidPtr(molcapsule);
plugin_c = (MolObject *)type->tp_alloc(type, 0);
plugin_c->plugin = plugin;
plugin_c->file_handle = plugin->open_file_read(fname, ftype, &natoms);
......@@ -3497,7 +3442,7 @@ PyObject * my_close_file_read(PyObject* molpack) {
void* file_handle;
int numatoms;
MolObject* plugin_handle = (MolObject*) molpack;
plugin = plugin_handle->plugin;
plugin = plugin_handle->plugin;
file_handle = plugin_handle->file_handle;
numatoms = plugin_handle->natoms;
plugin->close_file_read(file_handle);
......@@ -3515,7 +3460,7 @@ SWIGINTERN PyObject *_wrap_molfile_plugin_list(PyObject *SWIGUNUSEDPARM(self), P
int val1 ;
int ecode1 = 0 ;
PyObject * obj0 = 0 ;
molfile_plugin_t **result = 0 ;
PyObject *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:molfile_plugin_list",&obj0)) SWIG_fail;
ecode1 = SWIG_AsVal_int(obj0, &val1);
......@@ -3523,8 +3468,8 @@ SWIGINTERN PyObject *_wrap_molfile_plugin_list(PyObject *SWIGUNUSEDPARM(self), P
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "molfile_plugin_list" "', argument " "1"" of type '" "int""'");
}
arg1 = static_cast< int >(val1);
result = (molfile_plugin_t **)molfile_plugin_list(arg1);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_molfile_plugin_t, 0 | 0 );
result = (PyObject *)molfile_plugin_list(arg1);
resultobj = result;
return resultobj;
fail:
return NULL;
......@@ -3559,29 +3504,23 @@ fail:
SWIGINTERN PyObject *_wrap_get_plugin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
molfile_plugin_t **arg1 = (molfile_plugin_t **) 0 ;
PyObject *arg1 = (PyObject *) 0 ;
int arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
int val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
molfile_plugin_t *result = 0 ;
PyObject *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:get_plugin",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_molfile_plugin_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "get_plugin" "', argument " "1"" of type '" "molfile_plugin_t **""'");
}
arg1 = reinterpret_cast< molfile_plugin_t ** >(argp1);
arg1 = obj0;
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "get_plugin" "', argument " "2"" of type '" "int""'");
}
arg2 = static_cast< int >(val2);
result = (molfile_plugin_t *)get_plugin(arg1,arg2);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_molfile_plugin_t, 0 | 0 );
result = (PyObject *)get_plugin(arg1,arg2);
resultobj = result;
return resultobj;
fail:
return NULL;
......@@ -3590,10 +3529,8 @@ fail:
SWIGINTERN PyObject *_wrap_molfile_plugin_info(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
molfile_plugin_t **arg1 = (molfile_plugin_t **) 0 ;
PyObject *arg1 = (PyObject *) 0 ;
int arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
int val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
......@@ -3601,20 +3538,13 @@ SWIGINTERN PyObject *_wrap_molfile_plugin_info(PyObject *SWIGUNUSEDPARM(self), P
PyObject *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:molfile_plugin_info",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_molfile_plugin_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "molfile_plugin_info" "', argument " "1"" of type '" "molfile_plugin_t **""'");
}
arg1 = reinterpret_cast< molfile_plugin_t ** >(argp1);
arg1 = obj0;
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "molfile_plugin_info" "', argument " "2"" of type '" "int""'");
}
arg2 = static_cast< int >(val2);
{
result = (PyObject *)molfile_plugin_info(arg1,arg2);
if (PyErr_Occurred()) SWIG_fail;
}
result = (PyObject *)molfile_plugin_info(arg1,arg2);
resultobj = result;
return resultobj;
fail:
......@@ -3624,12 +3554,10 @@ fail:
SWIGINTERN PyObject *_wrap_open_file_read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
molfile_plugin_t *arg1 = (molfile_plugin_t *) 0 ;
PyObject *arg1 = (PyObject *) 0 ;
char *arg2 = (char *) 0 ;
char *arg3 = (char *) 0 ;
int arg4 ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
......@@ -3645,11 +3573,7 @@ SWIGINTERN PyObject *_wrap_open_file_read(PyObject *SWIGUNUSEDPARM(self), PyObje
PyObject *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OOOO:open_file_read",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_molfile_plugin_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "open_file_read" "', argument " "1"" of type '" "molfile_plugin_t *""'");
}
arg1 = reinterpret_cast< molfile_plugin_t * >(argp1);
arg1 = obj0;
res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "open_file_read" "', argument " "2"" of type '" "char *""'");
......@@ -3806,12 +3730,12 @@ fail:
static PyMethodDef SwigMethods[] = {
{ (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
{ (char *)"molfile_plugin_list", _wrap_molfile_plugin_list, METH_VARARGS, (char *)"molfile_plugin_list(maxsize) -> molfile_plugin_t **"},
{ (char *)"molfile_plugin_list", _wrap_molfile_plugin_list, METH_VARARGS, (char *)"molfile_plugin_list(maxsize) -> PyObject *"},