def _get_info(self):
result = ''
if (
self.kind != HistoryItemKind.FILE and
self.kind != HistoryItemKind.IMAGE and
not self.content_type
):
if self.kind != HistoryItemKind.LINK:
result = '%i chars, %i lines' % (len(self.raw), self.n_lines)
return result
if self.n_lines > 1:
result += _('%s items') % self.n_lines
else:
try:
size = os.path.getsize(self.raw.strip())
except FileNotFoundError:
result += _('No such file or directory')
else:
result += humanize.naturalsize(size, gnu=True)
if self._content_type:
result += ', Type: %s' % self._content_type
return result
评论列表
文章目录