Skip to content
Snippets Groups Projects
Commit 83679e2b authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

More debug out on import error.

parent 8bda178a
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,8 @@ import sys
try:
from .molfile import libpymolfile
except ImportError:
import traceback
traceback.print_exc()
warnings.warn("libpymolfile package not available, pymolfile does not work without its library!")
MAX_NUM_PLUGINS = 200
......@@ -18,8 +20,8 @@ def byte_str_decode(data, dectype=None):
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',
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:
......@@ -39,18 +41,18 @@ def plugins():
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)
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.
Returns: A list of tuples that includes the information and
capabilities of each molfile plugin. The information is
extracted from molfile_plugin_t.
"""
global C_MOLFILE_PLUGINS
numlist = libpymolfile.molfile_init()
if sys.version_info > (3,):
basestring = str
plugins_list = [
[byte_str_decode(item,
[byte_str_decode(item,
dectype="unicode_escape") for item in libpymolfile.molfile_plugin_info(
C_MOLFILE_PLUGINS, i)
] for i in range(numlist)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment