Beispiel #1
0
 def render_GET(self, request):
     context = client.create_context()
     d = client.collect(client.add_context(context),
                        client.get_session_info(),
                        client.get_torrent(self.torrent_hash))
     d.addCallback(self.ui.show_torrent, request)
     return server.NOT_DONE_YET
Beispiel #2
0
    def render_GET(self, request):
        print request.args
        filter_dict = {
                'state': first_arg_value(request, 'state', 'All'),
                'tracker_host': first_arg_value(request, 'tracker', 'All'),
        }

        sort_method = first_arg_value(request, 'sort', 'added_desc')
        sort = client.SORT_FUNCTIONS[sort_method]

        context = client.create_context({
                'filter_state': filter_dict['state'],
                'filter_tracker': filter_dict['tracker_host'],
                'sort_method': sort_method,
        })

        d = client.collect(client.add_context(context),
                           client.get_session_info(),
                           client.get_torrents(filter_dict, sort))
        d.addCallback(self.ui.show_torrents, request)
        return server.NOT_DONE_YET