'Creates a list of FlexGet entries from items loaded in deluge and stores them to self.entries'

def on_connect_success(self, result, task, config):

    from deluge.ui.client import client
    def on_get_torrents_status(torrents):
        config_path = os.path.expanduser(config.get(u'config_path', u''))
        for (hash, torrent_dict) in torrents.items():
            entry = Entry(deluge_id=hash, url=u'')
            if config_path:
                torrent_path = os.path.join(config_path, u'state', (hash + u'.torrent'))
                if os.path.isfile(torrent_path):
                    entry[u'location'] = torrent_path
                    if (not torrent_path.startswith(u'/')):
                        torrent_path = (u'/' + torrent_path)
                    entry[u'url'] = (u'file://' + torrent_path)
                else:
                    log.warning((u'Did    not    find    torrent    file    at    %s' % torrent_path))
            for (key, value) in torrent_dict.items():
                if (key in self.settings_map):
                    flexget_key = self.settings_map[key]
                else:
                    flexget_key = self.extra_settings_map[key]
                if isinstance(flexget_key, tuple):
                    (flexget_key, format_func) = flexget_key
                    value = format_func(value)
                entry[flexget_key] = value
            self.entries.append(entry)
        client.disconnect()
    filter = config.get(u'filter', {})
    client.core.get_torrents_status(filter, native((list(self.settings_map.keys()) + config.get(u'keys', [])))).addCallback(on_get_torrents_status)
