Cython: Views: improved repr() method
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user