def _helper(name, filetype): return { 'filepath': os.path.join(self.path, name), 'filetype': filetype, 'filename': name, 'filedate': STORAGE.modified_time(os.path.join(self.path, name)), 'filesize': sizeof_fmt(STORAGE.size(os.path.join(self.path, name))), }
def file_details(self): filename = self.path.rsplit('/', 1)[-1] return { 'directory': os.path.dirname(self.path), 'filepath': self.path, 'filename': filename, 'filesize': sizeof_fmt(STORAGE.size(self.location)), 'filedate': STORAGE.modified_time(self.location), 'fileurl': self.url, }