From d83398c0e0815edb4f0e4519256ad53bde62a637 Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Sat, 21 Sep 2019 18:28:56 +0200 Subject: [PATCH] Cython: View: lines from simple View instances are now displayed in tab instead of dict format --- python/obitools3/dms/view/view.pyx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/python/obitools3/dms/view/view.pyx b/python/obitools3/dms/view/view.pyx index 1c57297..003c960 100755 --- a/python/obitools3/dms/view/view.pyx +++ b/python/obitools3/dms/view/view.pyx @@ -46,6 +46,8 @@ from ..capi.obitypes cimport is_a_DNA_seq, \ from ..capi.obidms cimport obi_import_view +from obitools3.format.tab import TabFormat + import importlib import inspect import pkgutil @@ -747,14 +749,9 @@ cdef class Line : def __repr__(self): - cdef dict line - cdef bytes column_name_b - cdef str column_name_str - line = {} - for column_name_b in self._view.keys() : - column_name_str = bytes2str(column_name_b) - line[column_name_str] = self[column_name_str] - return str(line) + formatter = TabFormat(header=False) + return bytes2str(formatter(self)) + # View property getter @property