def display_files(self, pcs_files):
        '''重新格式化一下文件列表, 去除不需要的信息

        这一操作主要是为了便于接下来的查找工作.
        文件的path都被提取出来, 然后放到了一个list中.
        '''
        tree_iters = []
        for pcs_file in pcs_files:
            path = pcs_file['path']
            pixbuf, type_ = self.app.mime.get(path, pcs_file['isdir'],
                                              icon_size=self.ICON_SIZE)
            name = os.path.split(path)[NAME_COL]
            tooltip = gutil.escape(name)
            size = pcs_file.get('size', 0)
            if pcs_file['isdir']:
                human_size = '--'
            else:
                human_size = util.get_human_size(pcs_file['size'])[0]
            mtime = pcs_file.get('server_mtime', 0)
            human_mtime = time.ctime(mtime)
            tree_iter = self.liststore.append([
                pixbuf, name, path, tooltip, size, human_size,
                pcs_file['isdir'], mtime, human_mtime, type_,
                json.dumps(pcs_file)
            ])
            tree_iters.append(tree_iter)
        cache_path = Config.get_cache_path(self.app.profile['username'])
        gutil.async_call(gutil.update_liststore_image, self.liststore,
                         tree_iters, PIXBUF_COL, pcs_files, cache_path,
                         self.ICON_SIZE)
def display_files ( self , pcs_files ) : tree_iters = [ ] for pcs_file in pcs_files : path = pcs_file [ 'path' ] pixbuf , type_ = self . app . mime . get ( path , pcs_file [ 'isdir' ] , icon_size = self . ICON_SIZE ) name = os . path . split ( path ) [ NAME_COL ] tooltip = gutil . escape ( name ) size = pcs_file . get ( 'size' , 0 ) if pcs_file [ 'isdir' ] : human_size = '--' else : human_size = util . get_human_size ( pcs_file [ 'size' ] ) [ 0 ] mtime = pcs_file . get ( 'server_mtime' , 0 ) human_mtime = time . ctime ( mtime ) tree_iter = self . liststore . append ( [ pixbuf , name , path , tooltip , size , human_size , pcs_file [ 'isdir' ] , mtime , human_mtime , type_ , json . dumps ( pcs_file ) ] ) tree_iters . append ( tree_iter ) cache_path = Config . get_cache_path ( self . app . profile [ 'username' ] ) gutil . async_call ( gutil . update_liststore_image , self . liststore , tree_iters , PIXBUF_COL , pcs_files , cache_path , self . ICON_SIZE )
重新格式化一下文件列表, 去除不需要的信息

        这一操作主要是为了便于接下来的查找工作.
        文件的path都被提取出来, 然后放到了一个list中.