Views: Added argument to not automatically create default columns in
typed views, a function to delete a view and fixed view history bug
This commit is contained in:
@ -60,7 +60,7 @@ cdef extern from "obiview.h" nogil:
|
||||
ctypedef Obiview_t* Obiview_p
|
||||
|
||||
|
||||
Obiview_p obi_new_view_nuc_seqs(OBIDMS_p dms, const_char_p view_name, Obiview_p view_to_clone, index_t* line_selection, const_char_p comments, bint quality_column)
|
||||
Obiview_p obi_new_view_nuc_seqs(OBIDMS_p dms, const_char_p view_name, Obiview_p view_to_clone, index_t* line_selection, const_char_p comments, bint quality_column, bint create_default_columns)
|
||||
|
||||
Obiview_p obi_new_view(OBIDMS_p dms, const_char_p view_name, Obiview_p view_to_clone, index_t* line_selection, const_char_p comments)
|
||||
|
||||
@ -113,6 +113,8 @@ cdef extern from "obiview.h" nogil:
|
||||
|
||||
int obi_rollback_view(Obiview_p view)
|
||||
|
||||
int obi_delete_view(OBIDMS_p dms, const char* view_name)
|
||||
|
||||
|
||||
# OBI_INT
|
||||
int obi_set_int_with_elt_name_and_col_p_in_view(Obiview_p view,
|
||||
|
@ -43,7 +43,8 @@ cdef class View_NUC_SEQS(View):
|
||||
NULL,
|
||||
NULL,
|
||||
comments_b,
|
||||
quality)
|
||||
quality,
|
||||
True)
|
||||
|
||||
if pointer == NULL :
|
||||
message = "Error : Cannot create view %s" % bytes2str(view_name_b)
|
||||
|
@ -15,7 +15,8 @@ from ..capi.obiview cimport Alias_column_pair_p, \
|
||||
obi_view_get_pointer_on_column_in_view, \
|
||||
obi_view_delete_column, \
|
||||
obi_view_create_column_alias, \
|
||||
obi_view_write_comments
|
||||
obi_view_write_comments, \
|
||||
obi_delete_view
|
||||
|
||||
from ..capi.obidmscolumn cimport OBIDMS_column_p
|
||||
from ..capi.obidms cimport OBIDMS_p
|
||||
@ -66,7 +67,13 @@ cdef class View(OBIWrapper) :
|
||||
def import_view(object dms_1, object dms_2, object view_name_1, object view_name_2):
|
||||
if obi_import_view(tobytes(dms_1), tobytes(dms_2), tobytes(view_name_1), tobytes(view_name_2)) < 0 :
|
||||
raise Exception("Error importing a view")
|
||||
|
||||
|
||||
|
||||
@staticmethod
|
||||
def delete_view(DMS dms, object view_name):
|
||||
if (obi_delete_view(dms.pointer(), tobytes(view_name)) < 0):
|
||||
raise Exception("Error deleting a view")
|
||||
|
||||
|
||||
@staticmethod
|
||||
def new(DMS dms,
|
||||
@ -533,6 +540,8 @@ cdef class View(OBIWrapper) :
|
||||
for i in range(len(element.comments[b"input_dms_name"])) :
|
||||
if element.comments[b"input_dms_name"][i] == element.dms.name and b"/" not in element.comments[b"input_view_name"][i]: # Same DMS and not a special element like a taxonomy
|
||||
top_level.append(element.dms[element.comments[b"input_view_name"][i]])
|
||||
else:
|
||||
top_level.append(None)
|
||||
else:
|
||||
top_level.append(None)
|
||||
level_dict[tuple(element.comments[b"input_str"])] = {}
|
||||
|
Reference in New Issue
Block a user