1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-21 17:56:19 +02:00

Merge branch 'fix_osc_ls_l_empty_size_but_not_empyt_mtime' of https://github.com/lethliel/osc

Do not fail in do_list if f.size or f.mtime is None.
This commit is contained in:
Marcus Huewe 2019-07-13 16:45:27 +02:00
commit ba0f07db6a

View File

@ -393,6 +393,10 @@ class Osc(cmdln.Cmdln):
for f in result[1]: for f in result[1]:
if f.size is None and f.mtime is None: if f.size is None and f.mtime is None:
print("%9s %12s %-40s" % ('unknown', 'unknown', f.name)) print("%9s %12s %-40s" % ('unknown', 'unknown', f.name))
elif f.size is None and f.mtime is not None:
print("%9s %s %-40s" % ('unknown', shorttime(f.mtime), f.name))
elif f.size is not None and f.mtime is None:
print("%9d %12s %-40s" % (f.size, 'unknown', f.name))
else: else:
print("%9d %s %-40s" % (f.size, shorttime(f.mtime), f.name)) print("%9d %s %-40s" % (f.size, shorttime(f.mtime), f.name))
else: else: