def append_filelist(self, infos, error=None): self.loading_spin.stop() self.loading_spin.hide() if error or not infos or infos['errno'] != 0: return for pcs_file in infos['list']: self.filelist.append(pcs_file) path = pcs_file['path'] icon_name = self.app.mime.get_icon_name(path, pcs_file['isdir']) tooltip = gutil.escape(path) if pcs_file['isdir'] or 'size' not in pcs_file: size = 0 humansize = '' else: size = pcs_file['size'] humansize = util.get_human_size(size)[0] remaining_days = util.get_delta_days( int(pcs_file['server_mtime']), time.time()) remaining_days = str(MAX_DAYS - remaining_days) + ' days' self.liststore.append([ icon_name, pcs_file['server_filename'], path, str(pcs_file['fs_id']), tooltip, size, humansize, time.ctime(pcs_file['server_mtime']), remaining_days, ])
def append_filelist(self, infos, error=None): if error or not infos or infos['errno'] != 0: return for pcs_file in infos['list']: self.filelist.append(pcs_file) path = pcs_file['path'] icon_name = self.app.mime.get_icon_name(path, pcs_file['isdir']) tooltip = path if pcs_file['isdir']: size = '' else: size, _ = util.get_human_size(pcs_file['size']) remaining_days = util.get_delta_days( int(pcs_file['server_mtime']), time.time()) remaining_days = str(MAX_DAYS - remaining_days) + ' days' self.liststore.append([ icon_name, pcs_file['server_filename'], path, pcs_file['fs_id'], tooltip, size, time.ctime(pcs_file['server_mtime']), remaining_days, ])
def append_filelist(self, infos, error=None): self.loading_spin.stop() self.loading_spin.hide() if error or not infos or infos['errno'] != 0: return for pcs_file in infos['list']: self.filelist.append(pcs_file) path = pcs_file['path'] icon_name = self.app.mime.get_icon_name(path, pcs_file['isdir']) tooltip = gutil.escape(path) if pcs_file['isdir'] or 'size' not in pcs_file: size = 0 humansize = '' else: size = pcs_file['size'] humansize = util.get_human_size(size)[0] remaining_days = util.get_delta_days(int(pcs_file['server_mtime']), time.time()) remaining_days = str(MAX_DAYS - remaining_days) + ' days' self.liststore.append([ icon_name, pcs_file['server_filename'], path, str(pcs_file['fs_id']), tooltip, size, humansize, time.ctime(pcs_file['server_mtime']), remaining_days, ])
def append_filelist(self, info, error=None): self.loading_spin.stop() self.loading_spin.hide() if not info: self.app.toast(_('Network error')) elif info.get('errno', -1) != 0 and info.get('errno', -1) != 31034: self.app.toast(info.get('error_msg', _('Network error'))) if error or not info or info.get('errno', -1) != 0: if error or not info or info.get('errno', -1) != 31034: logger.error('TrashPage.append_filelist: %s, %s' % (info, error)) return for pcs_file in info['list']: self.filelist.append(pcs_file) path = pcs_file['path'] icon_name = self.app.mime.get_icon_name(path, pcs_file['isdir']) tooltip = gutil.escape(path) if pcs_file['isdir'] or 'size' not in pcs_file: size = 0 humansize = '' else: size = pcs_file['size'] humansize = util.get_human_size(size)[0] remaining_days = util.get_delta_days(int(pcs_file['server_mtime']), time.time()) remaining_days = str(MAX_DAYS - remaining_days) + ' days' self.liststore.append([ icon_name, pcs_file['server_filename'], path, str(pcs_file['fs_id']), tooltip, size, humansize, time.ctime(pcs_file['server_mtime']), remaining_days, ])
def append_filelist(self, info, error=None): self.loading_spin.stop() self.loading_spin.hide() if not info: self.app.toast(_('Network error')) elif info.get('errno', -1) != 0: self.app.toast(info.get('error_msg', _('Network error'))) if error or not info or info.get('errno', -1) != 0: logger.error('TrashPage.append_filelist: %s, %s' % (info, error)) return for pcs_file in info['list']: self.filelist.append(pcs_file) path = pcs_file['path'] icon_name = self.app.mime.get_icon_name(path, pcs_file['isdir']) tooltip = gutil.escape(path) if pcs_file['isdir'] or 'size' not in pcs_file: size = 0 humansize = '' else: size = pcs_file['size'] humansize = util.get_human_size(size)[0] remaining_days = util.get_delta_days(int(pcs_file['server_mtime']), time.time()) remaining_days = str(MAX_DAYS - remaining_days) + ' days' self.liststore.append([ icon_name, pcs_file['server_filename'], path, str(pcs_file['fs_id']), tooltip, size, humansize, time.ctime(pcs_file['server_mtime']), remaining_days, ])