Cython API: None values aren't inclued anymore in the dictionary
returned when getting a line from a column with multiple elements per line, and reworked that function to be more optimized
This commit is contained in:
@ -12,7 +12,10 @@ from obitools3.utils cimport tobytes, \
|
|||||||
from ...capi.obiview cimport obi_get_bool_with_elt_name_and_col_p_in_view, \
|
from ...capi.obiview cimport obi_get_bool_with_elt_name_and_col_p_in_view, \
|
||||||
obi_get_bool_with_elt_idx_and_col_p_in_view, \
|
obi_get_bool_with_elt_idx_and_col_p_in_view, \
|
||||||
obi_set_bool_with_elt_name_and_col_p_in_view, \
|
obi_set_bool_with_elt_name_and_col_p_in_view, \
|
||||||
obi_set_bool_with_elt_idx_and_col_p_in_view
|
obi_set_bool_with_elt_idx_and_col_p_in_view, \
|
||||||
|
Obiview_p
|
||||||
|
|
||||||
|
from ...capi.obidmscolumn cimport OBIDMS_column_p
|
||||||
|
|
||||||
from ...capi.obitypes cimport OBI_BOOL, OBIBool_NA, obibool_t
|
from ...capi.obitypes cimport OBI_BOOL, OBIBool_NA, obibool_t
|
||||||
|
|
||||||
@ -32,7 +35,6 @@ cdef class Column_bool(Column):
|
|||||||
elements_names=elements_names,
|
elements_names=elements_names,
|
||||||
comments=comments)
|
comments=comments)
|
||||||
|
|
||||||
|
|
||||||
cpdef object get_line(self, index_t line_nb):
|
cpdef object get_line(self, index_t line_nb):
|
||||||
global obi_errno
|
global obi_errno
|
||||||
cdef obibool_t value
|
cdef obibool_t value
|
||||||
@ -45,7 +47,6 @@ cdef class Column_bool(Column):
|
|||||||
result = PyBool_FromLong(value)
|
result = PyBool_FromLong(value)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
cpdef set_line(self, index_t line_nb, object value):
|
cpdef set_line(self, index_t line_nb, object value):
|
||||||
global obi_errno
|
global obi_errno
|
||||||
if value is None :
|
if value is None :
|
||||||
@ -76,21 +77,25 @@ cdef class Column_multi_elts_bool(Column_multi_elts):
|
|||||||
cpdef object get_line(self, index_t line_nb) :
|
cpdef object get_line(self, index_t line_nb) :
|
||||||
global obi_errno
|
global obi_errno
|
||||||
cdef obibool_t value
|
cdef obibool_t value
|
||||||
cdef object value_in_result
|
cdef bint value_in_result
|
||||||
cdef dict result
|
cdef dict result
|
||||||
cdef index_t i
|
cdef index_t i
|
||||||
cdef bint all_NA
|
cdef bint all_NA
|
||||||
|
cdef list elements_names
|
||||||
|
cdef Obiview_p view_p
|
||||||
|
cdef OBIDMS_column_p column_p
|
||||||
result = {}
|
result = {}
|
||||||
all_NA = True
|
all_NA = True
|
||||||
|
view_p = self._view.pointer()
|
||||||
|
column_p = self.pointer()
|
||||||
|
elements_names = self.elements_names
|
||||||
for i in range(self.nb_elements_per_line) :
|
for i in range(self.nb_elements_per_line) :
|
||||||
value = obi_get_bool_with_elt_idx_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, i)
|
value = obi_get_bool_with_elt_idx_and_col_p_in_view(view_p, column_p, line_nb, i)
|
||||||
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=i, error_message="Problem getting a value from a column")
|
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=i, error_message="Problem getting a value from a column")
|
||||||
if value == OBIBool_NA :
|
if value != OBIBool_NA :
|
||||||
value_in_result = None
|
|
||||||
else :
|
|
||||||
value_in_result = PyBool_FromLong(value)
|
value_in_result = PyBool_FromLong(value)
|
||||||
result[self.elements_names[i]] = value_in_result
|
result[elements_names[i]] = value_in_result
|
||||||
if all_NA and (value_in_result is not None) :
|
if all_NA :
|
||||||
all_NA = False
|
all_NA = False
|
||||||
if all_NA :
|
if all_NA :
|
||||||
result = None
|
result = None
|
||||||
|
@ -12,7 +12,10 @@ from obitools3.utils cimport tobytes, \
|
|||||||
from ...capi.obiview cimport obi_get_char_with_elt_name_and_col_p_in_view, \
|
from ...capi.obiview cimport obi_get_char_with_elt_name_and_col_p_in_view, \
|
||||||
obi_get_char_with_elt_idx_and_col_p_in_view, \
|
obi_get_char_with_elt_idx_and_col_p_in_view, \
|
||||||
obi_set_char_with_elt_name_and_col_p_in_view, \
|
obi_set_char_with_elt_name_and_col_p_in_view, \
|
||||||
obi_set_char_with_elt_idx_and_col_p_in_view
|
obi_set_char_with_elt_idx_and_col_p_in_view, \
|
||||||
|
Obiview_p
|
||||||
|
|
||||||
|
from ...capi.obidmscolumn cimport OBIDMS_column_p
|
||||||
|
|
||||||
from ...capi.obitypes cimport OBI_CHAR, OBIChar_NA, obichar_t
|
from ...capi.obitypes cimport OBI_CHAR, OBIChar_NA, obichar_t
|
||||||
|
|
||||||
@ -77,21 +80,25 @@ cdef class Column_multi_elts_char(Column_multi_elts):
|
|||||||
cpdef object get_line(self, index_t line_nb) :
|
cpdef object get_line(self, index_t line_nb) :
|
||||||
global obi_errno
|
global obi_errno
|
||||||
cdef obichar_t value
|
cdef obichar_t value
|
||||||
cdef object value_in_result
|
cdef bytes value_in_result
|
||||||
cdef dict result
|
cdef dict result
|
||||||
cdef index_t i
|
cdef index_t i
|
||||||
cdef bint all_NA
|
cdef bint all_NA
|
||||||
|
cdef list elements_names
|
||||||
|
cdef Obiview_p view_p
|
||||||
|
cdef OBIDMS_column_p column_p
|
||||||
result = {}
|
result = {}
|
||||||
all_NA = True
|
all_NA = True
|
||||||
|
view_p = self._view.pointer()
|
||||||
|
column_p = self.pointer()
|
||||||
|
elements_names = self.elements_names
|
||||||
for i in range(self.nb_elements_per_line) :
|
for i in range(self.nb_elements_per_line) :
|
||||||
value = obi_get_char_with_elt_idx_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, i)
|
value = obi_get_char_with_elt_idx_and_col_p_in_view(view_p, column_p, line_nb, i)
|
||||||
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=i, error_message="Problem getting a value from a column")
|
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=i, error_message="Problem getting a value from a column")
|
||||||
if value == OBIChar_NA :
|
if value != OBIChar_NA :
|
||||||
value_in_result = None
|
value_in_result = <bytes>value
|
||||||
else :
|
result[elements_names[i]] = value_in_result
|
||||||
value_in_result = <bytes>value # TODO return bytes or str?
|
if all_NA :
|
||||||
result[self.elements_names[i]] = value_in_result
|
|
||||||
if all_NA and (value_in_result is not None) :
|
|
||||||
all_NA = False
|
all_NA = False
|
||||||
if all_NA :
|
if all_NA :
|
||||||
result = None
|
result = None
|
||||||
|
@ -12,7 +12,10 @@ from obitools3.utils cimport tobytes, \
|
|||||||
from ...capi.obiview cimport obi_get_float_with_elt_name_and_col_p_in_view, \
|
from ...capi.obiview cimport obi_get_float_with_elt_name_and_col_p_in_view, \
|
||||||
obi_get_float_with_elt_idx_and_col_p_in_view, \
|
obi_get_float_with_elt_idx_and_col_p_in_view, \
|
||||||
obi_set_float_with_elt_name_and_col_p_in_view, \
|
obi_set_float_with_elt_name_and_col_p_in_view, \
|
||||||
obi_set_float_with_elt_idx_and_col_p_in_view
|
obi_set_float_with_elt_idx_and_col_p_in_view, \
|
||||||
|
Obiview_p
|
||||||
|
|
||||||
|
from ...capi.obidmscolumn cimport OBIDMS_column_p
|
||||||
|
|
||||||
from ...capi.obitypes cimport OBI_FLOAT, OBIFloat_NA, obifloat_t
|
from ...capi.obitypes cimport OBI_FLOAT, OBIFloat_NA, obifloat_t
|
||||||
|
|
||||||
@ -74,21 +77,25 @@ cdef class Column_multi_elts_float(Column_multi_elts):
|
|||||||
cpdef object get_line(self, index_t line_nb) :
|
cpdef object get_line(self, index_t line_nb) :
|
||||||
global obi_errno
|
global obi_errno
|
||||||
cdef obifloat_t value
|
cdef obifloat_t value
|
||||||
cdef object value_in_result
|
cdef double value_in_result
|
||||||
cdef dict result
|
cdef dict result
|
||||||
cdef index_t i
|
cdef index_t i
|
||||||
cdef bint all_NA
|
cdef bint all_NA
|
||||||
|
cdef list elements_names
|
||||||
|
cdef Obiview_p view_p
|
||||||
|
cdef OBIDMS_column_p column_p
|
||||||
result = {}
|
result = {}
|
||||||
all_NA = True
|
all_NA = True
|
||||||
|
view_p = self._view.pointer()
|
||||||
|
column_p = self.pointer()
|
||||||
|
elements_names = self.elements_names
|
||||||
for i in range(self.nb_elements_per_line) :
|
for i in range(self.nb_elements_per_line) :
|
||||||
value = obi_get_float_with_elt_idx_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, i)
|
value = obi_get_float_with_elt_idx_and_col_p_in_view(view_p, column_p, line_nb, i)
|
||||||
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=i, error_message="Problem getting a value from a column")
|
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=i, error_message="Problem getting a value from a column")
|
||||||
if value == OBIFloat_NA :
|
if value != OBIFloat_NA :
|
||||||
value_in_result = None
|
|
||||||
else :
|
|
||||||
value_in_result = <double> value
|
value_in_result = <double> value
|
||||||
result[self.elements_names[i]] = value_in_result
|
result[elements_names[i]] = value_in_result
|
||||||
if all_NA and (value_in_result is not None) :
|
if all_NA :
|
||||||
all_NA = False
|
all_NA = False
|
||||||
if all_NA :
|
if all_NA :
|
||||||
result = None
|
result = None
|
||||||
|
@ -12,7 +12,10 @@ from obitools3.utils cimport tobytes, \
|
|||||||
from ...capi.obiview cimport obi_get_int_with_elt_name_and_col_p_in_view, \
|
from ...capi.obiview cimport obi_get_int_with_elt_name_and_col_p_in_view, \
|
||||||
obi_get_int_with_elt_idx_and_col_p_in_view, \
|
obi_get_int_with_elt_idx_and_col_p_in_view, \
|
||||||
obi_set_int_with_elt_name_and_col_p_in_view, \
|
obi_set_int_with_elt_name_and_col_p_in_view, \
|
||||||
obi_set_int_with_elt_idx_and_col_p_in_view
|
obi_set_int_with_elt_idx_and_col_p_in_view, \
|
||||||
|
Obiview_p
|
||||||
|
|
||||||
|
from ...capi.obidmscolumn cimport OBIDMS_column_p
|
||||||
|
|
||||||
from ...capi.obitypes cimport OBI_INT, OBIInt_NA, obiint_t
|
from ...capi.obitypes cimport OBI_INT, OBIInt_NA, obiint_t
|
||||||
|
|
||||||
@ -77,21 +80,25 @@ cdef class Column_multi_elts_int(Column_multi_elts):
|
|||||||
cpdef object get_line(self, index_t line_nb) :
|
cpdef object get_line(self, index_t line_nb) :
|
||||||
global obi_errno
|
global obi_errno
|
||||||
cdef obiint_t value
|
cdef obiint_t value
|
||||||
cdef object value_in_result
|
cdef int value_in_result
|
||||||
cdef dict result
|
cdef dict result
|
||||||
cdef index_t i
|
cdef index_t i
|
||||||
cdef bint all_NA
|
cdef bint all_NA
|
||||||
|
cdef list elements_names
|
||||||
|
cdef Obiview_p view_p
|
||||||
|
cdef OBIDMS_column_p column_p
|
||||||
result = {}
|
result = {}
|
||||||
all_NA = True
|
all_NA = True
|
||||||
|
view_p = self._view.pointer()
|
||||||
|
column_p = self.pointer()
|
||||||
|
elements_names = self.elements_names
|
||||||
for i in range(self.nb_elements_per_line) :
|
for i in range(self.nb_elements_per_line) :
|
||||||
value = obi_get_int_with_elt_idx_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, i)
|
value = obi_get_int_with_elt_idx_and_col_p_in_view(view_p, column_p, line_nb, i)
|
||||||
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=i, error_message="Problem getting a value from a column")
|
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=i, error_message="Problem getting a value from a column")
|
||||||
if value == OBIInt_NA :
|
if value != OBIInt_NA :
|
||||||
value_in_result = None
|
|
||||||
else :
|
|
||||||
value_in_result = PyInt_FromLong(value)
|
value_in_result = PyInt_FromLong(value)
|
||||||
result[self.elements_names[i]] = value_in_result
|
result[elements_names[i]] = value_in_result
|
||||||
if all_NA and (value_in_result is not None) :
|
if all_NA :
|
||||||
all_NA = False
|
all_NA = False
|
||||||
if all_NA :
|
if all_NA :
|
||||||
result = None
|
result = None
|
||||||
|
@ -16,7 +16,10 @@ from ...capi.obiview cimport obi_get_qual_char_with_elt_name_and_col_p_in_view,
|
|||||||
obi_get_qual_int_with_elt_name_and_col_p_in_view, \
|
obi_get_qual_int_with_elt_name_and_col_p_in_view, \
|
||||||
obi_get_qual_int_with_elt_idx_and_col_p_in_view, \
|
obi_get_qual_int_with_elt_idx_and_col_p_in_view, \
|
||||||
obi_set_qual_int_with_elt_name_and_col_p_in_view, \
|
obi_set_qual_int_with_elt_name_and_col_p_in_view, \
|
||||||
obi_set_qual_int_with_elt_idx_and_col_p_in_view
|
obi_set_qual_int_with_elt_idx_and_col_p_in_view, \
|
||||||
|
Obiview_p
|
||||||
|
|
||||||
|
from ...capi.obidmscolumn cimport OBIDMS_column_p
|
||||||
|
|
||||||
from ...capi.obitypes cimport OBI_QUAL, OBIQual_char_NA, OBIQual_int_NA, const_char_p
|
from ...capi.obitypes cimport OBI_QUAL, OBIQual_char_NA, OBIQual_int_NA, const_char_p
|
||||||
|
|
||||||
@ -145,24 +148,28 @@ cdef class Column_multi_elts_qual(Column_multi_elts):
|
|||||||
global obi_errno
|
global obi_errno
|
||||||
cdef const uint8_t* value
|
cdef const uint8_t* value
|
||||||
cdef int value_length
|
cdef int value_length
|
||||||
cdef object value_in_result
|
cdef list value_in_result
|
||||||
cdef dict result
|
cdef dict result
|
||||||
cdef index_t i
|
cdef index_t i
|
||||||
cdef int j
|
cdef int j
|
||||||
cdef bint all_NA
|
cdef bint all_NA
|
||||||
|
cdef list elements_names
|
||||||
|
cdef Obiview_p view_p
|
||||||
|
cdef OBIDMS_column_p column_p
|
||||||
result = {}
|
result = {}
|
||||||
all_NA = True
|
all_NA = True
|
||||||
|
view_p = self._view.pointer()
|
||||||
|
column_p = self.pointer()
|
||||||
|
elements_names = self.elements_names
|
||||||
for i in range(self.nb_elements_per_line) :
|
for i in range(self.nb_elements_per_line) :
|
||||||
value = obi_get_qual_int_with_elt_idx_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, i, &value_length)
|
value = obi_get_qual_int_with_elt_idx_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, i, &value_length)
|
||||||
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=i, error_message="Problem getting a value from a column")
|
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=i, error_message="Problem getting a value from a column")
|
||||||
if value == OBIQual_int_NA :
|
if value != OBIQual_int_NA :
|
||||||
value_in_result = None
|
|
||||||
else :
|
|
||||||
value_in_result = []
|
value_in_result = []
|
||||||
for j in range(value_length) :
|
for j in range(value_length) :
|
||||||
value_in_result.append(<int>value[j])
|
value_in_result.append(<int>value[j])
|
||||||
result[self.elements_names[i]] = value_in_result
|
result[elements_names[i]] = value_in_result
|
||||||
if all_NA and (value_in_result is not None) :
|
if all_NA :
|
||||||
all_NA = False
|
all_NA = False
|
||||||
if all_NA :
|
if all_NA :
|
||||||
result = None
|
result = None
|
||||||
@ -176,18 +183,22 @@ cdef class Column_multi_elts_qual(Column_multi_elts):
|
|||||||
cdef dict result
|
cdef dict result
|
||||||
cdef index_t i
|
cdef index_t i
|
||||||
cdef bint all_NA
|
cdef bint all_NA
|
||||||
|
cdef list elements_names
|
||||||
|
cdef Obiview_p view_p
|
||||||
|
cdef OBIDMS_column_p column_p
|
||||||
result = {}
|
result = {}
|
||||||
all_NA = True
|
all_NA = True
|
||||||
|
view_p = self._view.pointer()
|
||||||
|
column_p = self.pointer()
|
||||||
|
elements_names = self.elements_names
|
||||||
for i in range(self.nb_elements_per_line) :
|
for i in range(self.nb_elements_per_line) :
|
||||||
value = obi_get_qual_char_with_elt_idx_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, i)
|
value = obi_get_qual_char_with_elt_idx_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, i)
|
||||||
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=i, error_message="Problem getting a value from a column")
|
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=i, error_message="Problem getting a value from a column")
|
||||||
if value == OBIQual_char_NA :
|
if value != OBIQual_char_NA :
|
||||||
value_in_result = None
|
|
||||||
else :
|
|
||||||
value_in_result = bytes2str(value)
|
value_in_result = bytes2str(value)
|
||||||
free(value)
|
free(value)
|
||||||
result[self.elements_names[i]] = value_in_result
|
result[elements_names[i]] = value_in_result
|
||||||
if all_NA and (value_in_result is not None) :
|
if all_NA :
|
||||||
all_NA = False
|
all_NA = False
|
||||||
if all_NA :
|
if all_NA :
|
||||||
result = None
|
result = None
|
||||||
|
@ -12,7 +12,10 @@ from obitools3.utils cimport tobytes, \
|
|||||||
from ...capi.obiview cimport obi_get_seq_with_elt_name_and_col_p_in_view, \
|
from ...capi.obiview cimport obi_get_seq_with_elt_name_and_col_p_in_view, \
|
||||||
obi_get_seq_with_elt_idx_and_col_p_in_view, \
|
obi_get_seq_with_elt_idx_and_col_p_in_view, \
|
||||||
obi_set_seq_with_elt_name_and_col_p_in_view, \
|
obi_set_seq_with_elt_name_and_col_p_in_view, \
|
||||||
obi_set_seq_with_elt_idx_and_col_p_in_view
|
obi_set_seq_with_elt_idx_and_col_p_in_view, \
|
||||||
|
Obiview_p
|
||||||
|
|
||||||
|
from ...capi.obidmscolumn cimport OBIDMS_column_p
|
||||||
|
|
||||||
from ...capi.obitypes cimport OBI_SEQ, OBISeq_NA
|
from ...capi.obitypes cimport OBI_SEQ, OBISeq_NA
|
||||||
|
|
||||||
@ -94,20 +97,24 @@ cdef class Column_multi_elts_seq(Column_multi_elts):
|
|||||||
cdef dict result
|
cdef dict result
|
||||||
cdef index_t i
|
cdef index_t i
|
||||||
cdef bint all_NA
|
cdef bint all_NA
|
||||||
|
cdef list elements_names
|
||||||
|
cdef Obiview_p view_p
|
||||||
|
cdef OBIDMS_column_p column_p
|
||||||
result = {}
|
result = {}
|
||||||
all_NA = True
|
all_NA = True
|
||||||
|
view_p = self._view.pointer()
|
||||||
|
column_p = self.pointer()
|
||||||
|
elements_names = self.elements_names
|
||||||
for i in range(self.nb_elements_per_line) :
|
for i in range(self.nb_elements_per_line) :
|
||||||
value = obi_get_seq_with_elt_idx_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, i)
|
value = obi_get_seq_with_elt_idx_and_col_p_in_view(view_p, column_p, line_nb, i)
|
||||||
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=i, error_message="Problem getting a value from a column")
|
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=i, error_message="Problem getting a value from a column")
|
||||||
if value == OBISeq_NA :
|
if value != OBISeq_NA :
|
||||||
value_in_result = None
|
|
||||||
else :
|
|
||||||
try:
|
try:
|
||||||
value_in_result = <bytes> value
|
value_in_result = <bytes> value
|
||||||
finally:
|
finally:
|
||||||
free(value)
|
free(value)
|
||||||
result[self.elements_names[i]] = value_in_result
|
result[elements_names[i]] = value_in_result
|
||||||
if all_NA and (value_in_result is not None) :
|
if all_NA :
|
||||||
all_NA = False
|
all_NA = False
|
||||||
if all_NA :
|
if all_NA :
|
||||||
result = None
|
result = None
|
||||||
|
@ -12,7 +12,10 @@ from obitools3.utils cimport tobytes, \
|
|||||||
from ...capi.obiview cimport obi_get_str_with_elt_name_and_col_p_in_view, \
|
from ...capi.obiview cimport obi_get_str_with_elt_name_and_col_p_in_view, \
|
||||||
obi_get_str_with_elt_idx_and_col_p_in_view, \
|
obi_get_str_with_elt_idx_and_col_p_in_view, \
|
||||||
obi_set_str_with_elt_name_and_col_p_in_view, \
|
obi_set_str_with_elt_name_and_col_p_in_view, \
|
||||||
obi_set_str_with_elt_idx_and_col_p_in_view
|
obi_set_str_with_elt_idx_and_col_p_in_view, \
|
||||||
|
Obiview_p
|
||||||
|
|
||||||
|
from ...capi.obidmscolumn cimport OBIDMS_column_p
|
||||||
|
|
||||||
from ...capi.obitypes cimport OBI_STR, OBIStr_NA, const_char_p
|
from ...capi.obitypes cimport OBI_STR, OBIStr_NA, const_char_p
|
||||||
|
|
||||||
@ -86,17 +89,21 @@ cdef class Column_multi_elts_str(Column_multi_elts):
|
|||||||
cdef dict result
|
cdef dict result
|
||||||
cdef index_t i
|
cdef index_t i
|
||||||
cdef bint all_NA
|
cdef bint all_NA
|
||||||
|
cdef list elements_names
|
||||||
|
cdef Obiview_p view_p
|
||||||
|
cdef OBIDMS_column_p column_p
|
||||||
result = {}
|
result = {}
|
||||||
all_NA = True
|
all_NA = True
|
||||||
|
view_p = self._view.pointer()
|
||||||
|
column_p = self.pointer()
|
||||||
|
elements_names = self.elements_names
|
||||||
for i in range(self.nb_elements_per_line) :
|
for i in range(self.nb_elements_per_line) :
|
||||||
value = obi_get_str_with_elt_idx_and_col_p_in_view(self._view.pointer(), self.pointer(), line_nb, i)
|
value = obi_get_str_with_elt_idx_and_col_p_in_view(view_p, column_p, line_nb, i)
|
||||||
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=i, error_message="Problem getting a value from a column")
|
obi_errno_to_exception(obi_errno, line_nb=line_nb, elt_id=i, error_message="Problem getting a value from a column")
|
||||||
if value == OBIStr_NA :
|
if value != OBIStr_NA :
|
||||||
value_in_result = None
|
|
||||||
else :
|
|
||||||
value_in_result = <bytes> value
|
value_in_result = <bytes> value
|
||||||
result[self.elements_names[i]] = value_in_result
|
result[elements_names[i]] = value_in_result
|
||||||
if all_NA and (value_in_result is not None) :
|
if all_NA :
|
||||||
all_NA = False
|
all_NA = False
|
||||||
if all_NA :
|
if all_NA :
|
||||||
result = None
|
result = None
|
||||||
|
Reference in New Issue
Block a user