1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
from __future__ import absolute_import, print_function
from . import common_info
from . import c_spec
#----------------------------------------------------------------------------
# The "standard" conversion classes
#----------------------------------------------------------------------------
default = [c_spec.int_converter(),
c_spec.float_converter(),
c_spec.complex_converter(),
c_spec.unicode_converter(),
c_spec.string_converter(),
c_spec.list_converter(),
c_spec.dict_converter(),
c_spec.tuple_converter(),
c_spec.file_converter(),
c_spec.instance_converter(),]
#----------------------------------------------------------------------------
# add numpy array converters to the default
# converter list.
#----------------------------------------------------------------------------
try:
from . import standard_array_spec
default.append(standard_array_spec.array_converter())
except ImportError:
pass
#----------------------------------------------------------------------------
# add numpy scalar converters to the default
# converter list.
#----------------------------------------------------------------------------
try:
from . import numpy_scalar_spec
default.append(numpy_scalar_spec.numpy_complex_scalar_converter())
except ImportError:
pass
#----------------------------------------------------------------------------
# Add VTK support
#----------------------------------------------------------------------------
try:
from . import vtk_spec
default.insert(0,vtk_spec.vtk_converter())
except IndexError:
pass
#----------------------------------------------------------------------------
# Add "sentinal" catchall converter
#
# if everything else fails, this one is the last hope (it always works)
#----------------------------------------------------------------------------
default.append(c_spec.catchall_converter())
standard_info = [common_info.basic_module_info()]
standard_info += [x.generate_build_info() for x in default]
#----------------------------------------------------------------------------
# Blitz conversion classes
#
# same as default, but will convert numpy arrays to blitz C++ classes
#----------------------------------------------------------------------------
try:
from . import blitz_spec
blitz = [blitz_spec.array_converter()] + default
#-----------------------------------
# Add "sentinal" catchall converter
#
# if everything else fails, this one
# is the last hope (it always works)
#-----------------------------------
blitz.append(c_spec.catchall_converter())
except:
pass
|