Ignore:
Timestamp:
Feb 12, 2011, 12:08:30 AM (11 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Message:

Properly pass verb element to parse methods, not just the last one.

Author: ralphm.
Fixes: #72.

This also cleans up a few pyflakes warnings, including a masked test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/pubsub.py

    r90 r92  
    11# -*- test-case-name: wokkel.test.test_pubsub -*-
    22#
    3 # Copyright (c) 2003-2010 Ralph Meijer
     3# Copyright (c) 2003-2011 Ralph Meijer
    44# See LICENSE for details.
    55
     
    534534
    535535        verbs = []
    536         children = []
     536        verbElements = []
    537537        for child in element.pubsub.elements():
    538538            key = (self.stanzaType, child.uri, child.name)
     
    543543
    544544            verbs.append(verb)
    545             children.append(child)
     545            verbElements.append(child)
    546546
    547547        if not verbs:
     
    551551            if 'optionsSet' in verbs and 'subscribe' in verbs:
    552552                self.verb = 'subscribe'
    553                 child = children[verbs.index('subscribe')]
     553                verbElement = verbElements[verbs.index('subscribe')]
    554554            else:
    555555                raise NotImplementedError()
    556556        else:
    557557            self.verb = verbs[0]
     558            verbElement = verbElements[0]
    558559
    559560        for parameter in self._parameters[self.verb]:
    560             getattr(self, '_parse_%s' % parameter)(child)
     561            getattr(self, '_parse_%s' % parameter)(verbElement)
    561562
    562563
     
    11821183    def _toResponse_subscribe(self, result, resource, request):
    11831184        response = domish.Element((NS_PUBSUB, "pubsub"))
    1184         subscription = response.addChild(result.toElement())
     1185        response.addChild(result.toElement())
    11851186        return response
    11861187
Note: See TracChangeset for help on using the changeset viewer.