From da76f911db9bd1dba140d31841919b23be715aaa Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Wed, 17 Oct 2018 15:54:03 +0200 Subject: [PATCH] Cython: Views: improved repr() method --- python/obitools3/dms/view/view.pyx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/obitools3/dms/view/view.pyx b/python/obitools3/dms/view/view.pyx index 933feb9..2b19bdc 100644 --- a/python/obitools3/dms/view/view.pyx +++ b/python/obitools3/dms/view/view.pyx @@ -169,9 +169,9 @@ cdef class View(OBIWrapper) : @OBIWrapper.checkIsActive def __repr__(self) : - cdef str s = "{name:s}\n{comments:s}\n{line_count:d} lines\n".format(name = str(self.name), - comments = str(self.comments), - line_count = self.line_count) + cdef str s = "#View name:\n{name:s}\n#Comments:\n{comments:s}\n#Line count:\n{line_count:d}\n#Columns:\n".format(name = bytes2str(self.name), + comments = str(self.comments), + line_count = self.line_count) for column_name in self.keys() : s = s + repr(self[column_name]) + '\n' return s @@ -367,7 +367,7 @@ cdef class View(OBIWrapper) : @staticmethod def _config_to_dict(dict config, str command_name, str command_line, list input_str=None, list input_dms_name=None, list input_view_name=None): - INVALID_KEYS = ["__root_config__", "module", "nocreatedms", "logger", "defaultdms", "inputview", "outputview", "log", "loglevel", "progress"] + INVALID_KEYS = ["__root_config__", "module", "nocreatedms", "logger", "defaultdms", "inputview", "outputview", "log", "loglevel", "progress", "verbose"] comments = {} comments["obi"] = {k: config["obi"][k] for k in config["obi"] if k not in INVALID_KEYS} comments[command_name] = config[command_name] # TODO or discuss update instead of nested dict