Cython API to import a column and a view from a DMS to another DMS

This commit is contained in:
Celine Mercier
2017-08-03 16:34:02 +02:00
parent 4b86aa67a8
commit 7f1ff49aa2
3 changed files with 25 additions and 4 deletions

View File

@ -8,8 +8,10 @@ __OBIDMS_COLUMN_CLASS__ = {}
from ..capi.obitypes cimport name_data_type, \
obitype_t, \
OBI_BOOL
obiversion_t
from ..capi.obidms cimport obi_import_column
from ..capi.obidmscolumn cimport OBIDMS_column_header_p, \
obi_close_column, \
obi_get_elements_names
@ -59,6 +61,15 @@ cdef class Column(OBIWrapper) :
return __OBIDMS_COLUMN_CLASS__[(obitype, multi_elts)][1]
@staticmethod
def import_column(object dms_1, object dms_2, object column_name, obiversion_t version_number):
cdef obiversion_t new_version
new_version = obi_import_column(tobytes(dms_1), tobytes(dms_2), tobytes(column_name), version_number)
if new_version < 0 :
raise Exception("Error importing a column")
return new_version
@staticmethod
def new_column(View view,
object column_name,