diff --git a/python/obitools3/obidms/_obidms.pyx b/python/obitools3/obidms/_obidms.pyx index 1824385..cbf73ad 100644 --- a/python/obitools3/obidms/_obidms.pyx +++ b/python/obitools3/obidms/_obidms.pyx @@ -694,14 +694,20 @@ cdef class OBIDMS : cdef object view_class + # Get right subclass depending on view type if view_type is not None : if view_type == bytes2str(VIEW_TYPE_NUC_SEQS) : view_class = OBIView_NUC_SEQS else : view_class = OBIView + # Check the type of the view to clone if there is one # TODO make generic for future other view types + if view_to_clone is not None and \ + ((type(view_to_clone) == str and self.read_view_infos(view_to_clone)["view_type"] == VIEW_TYPE_NUC_SEQS) or \ + isinstance(view_to_clone, OBIView_NUC_SEQS)) : + view_class = OBIView_NUC_SEQS return view_class(self, view_name, new=True, view_to_clone=view_to_clone, line_selection=line_selection, comments=comments) - + cpdef dict read_view_infos(self, str view_name) :