Commit 83679e2b authored by Markus Scheidgen's avatar Markus Scheidgen

More debug out on import error.

parent 8bda178a
...@@ -4,6 +4,8 @@ import sys ...@@ -4,6 +4,8 @@ import sys
try: try:
from .molfile import libpymolfile from .molfile import libpymolfile
except ImportError: except ImportError:
import traceback
traceback.print_exc()
warnings.warn("libpymolfile package not available, pymolfile does not work without its library!") warnings.warn("libpymolfile package not available, pymolfile does not work without its library!")
MAX_NUM_PLUGINS = 200 MAX_NUM_PLUGINS = 200
...@@ -18,8 +20,8 @@ def byte_str_decode(data, dectype=None): ...@@ -18,8 +20,8 @@ def byte_str_decode(data, dectype=None):
def plugins(): def plugins():
""" Information on the available molfile plugins """ Information on the available molfile plugins
Example tuple: ('psf', 'psf', 1, 1, 1, 0, 1, 1, 1, 0, Example tuple: ('psf', 'psf', 1, 1, 1, 0, 1, 1, 1, 0,
'CHARMM,NAMD,XPLOR PSF', 'mol file reader', 'CHARMM,NAMD,XPLOR PSF', 'mol file reader',
'Justin Gullingsrud, John Stone', 1, 9, 17, 1) 'Justin Gullingsrud, John Stone', 1, 9, 17, 1)
The fields in the tuple represent info in ordered as follows: The fields in the tuple represent info in ordered as follows:
...@@ -39,18 +41,18 @@ def plugins(): ...@@ -39,18 +41,18 @@ def plugins():
14: major version of the plugin 14: major version of the plugin
15: minor version of the plugin 15: minor version of the plugin
16: ABI 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 Returns: A list of tuples that includes the information and
capabilities of each molfile plugin. The information is capabilities of each molfile plugin. The information is
extracted from molfile_plugin_t. extracted from molfile_plugin_t.
""" """
global C_MOLFILE_PLUGINS global C_MOLFILE_PLUGINS
numlist = libpymolfile.molfile_init() numlist = libpymolfile.molfile_init()
if sys.version_info > (3,): if sys.version_info > (3,):
basestring = str basestring = str
plugins_list = [ plugins_list = [
[byte_str_decode(item, [byte_str_decode(item,
dectype="unicode_escape") for item in libpymolfile.molfile_plugin_info( dectype="unicode_escape") for item in libpymolfile.molfile_plugin_info(
C_MOLFILE_PLUGINS, i) C_MOLFILE_PLUGINS, i)
] for i in range(numlist) ] for i in range(numlist)
......
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