From 7a39df54c019806e67cd7e60282882918a32382d Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Sat, 13 Jun 2020 21:45:22 +0200 Subject: [PATCH] ls: fixed an issue where big DMS couldn't be read by ls --- python/obitools3/commands/ls.pyx | 7 ++++--- python/obitools3/dms/dms.pyx | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/python/obitools3/commands/ls.pyx b/python/obitools3/commands/ls.pyx index 62b98dd..74a504a 100755 --- a/python/obitools3/commands/ls.pyx +++ b/python/obitools3/commands/ls.pyx @@ -34,9 +34,10 @@ def run(config): if input[2] == DMS and not config['ls']['longformat']: dms = input[0] l = [] - for view in input[0]: - l.append(tostr(view) + "\t(Date created: " + str(bytes2str_object(dms[view].comments["Date created"]))+")") - dms[view].close() + for viewname in input[0]: + view = dms[viewname] + l.append(tostr(viewname) + "\t(Date created: " + str(bytes2str_object(view.comments["Date created"]))+")") + view.close() l.sort() for v in l: print(v) diff --git a/python/obitools3/dms/dms.pyx b/python/obitools3/dms/dms.pyx index 58bae28..6cf9a02 100755 --- a/python/obitools3/dms/dms.pyx +++ b/python/obitools3/dms/dms.pyx @@ -227,7 +227,9 @@ cdef class DMS(OBIWrapper): cdef str s s="" for view_name in self.keys(): - s = s + repr(self.get_view(view_name)) + "\n" + view = self.get_view(view_name) + s = s + repr(view) + "\n" + view.close() return s