def request_data(self):
        '''在调用dialog.run()之前先调用这个函数来获取数据'''
        def on_tasks_received(info, error=None):
            if error or not info:
                logger.error('BTBrowserDialog.on_tasks_received: %s, %s.' %
                             (info, error))
                return
            if 'magnet_info' in info:
                tasks = info['magnet_info']
            elif 'torrent_info' in info:
                tasks = info['torrent_info']['file_info']
                self.file_sha1 = info['torrent_info']['sha1']
            elif 'error_code' in info:
                logger.error('BTBrowserDialog.on_tasks_received: %s, %s.' %
                             (info, error))
                self.app.toast(info.get('error_msg', ''))
                return
            else:
                logger.error('BTBrowserDialog.on_tasks_received: %s, %s.' %
                             (info, error))
                self.app.toast(_('Unknown error occured: %s') % info)
                return
            for task in tasks:
                size = int(task['size'])
                human_size = util.get_human_size(size)[0]
                select = (size > MIN_SIZE_TO_CHECK or 
                          task['file_name'].endswith(CHECK_EXT))
                self.liststore.append([
                    select,
                    task['file_name'],
                    size,
                    human_size,
                ])

        if self.source_url.startswith('magnet'):
            gutil.async_call(pcs.cloud_query_magnetinfo, self.app.cookie,
                             self.app.tokens, self.source_url, self.save_path,
                             callback=on_tasks_received)
        else:
            gutil.async_call(pcs.cloud_query_sinfo, self.app.cookie,
                             self.app.tokens, self.source_url,
                             callback=on_tasks_received)
在调用dialog.run()之前先调用这个函数来获取数据