示例#1
0
    def setup(self, xml=None):
        """
        Populate the stanza object using an optional XML object.

        Overrides ElementBase.setup

        Caches item information.

        Arguments:
            xml -- Use an existing XML object for the stanza's values.
        """
        ElementBase.setup(self, xml)
        self._datas = set([data['name'] for data in self['datas']])
示例#2
0
    def setup(self, xml=None):
        """
        Populate the stanza object using an optional XML object.

        Overrides ElementBase.setup

        Caches item information.

        Arguments:
            xml -- Use an existing XML object for the stanza's values.
        """
        ElementBase.setup(self, xml)
        self._nodes = set([node['nodeId'] for node in self['nodes']])
        self._fields = set([field['name'] for field in self['fields']])
示例#3
0
文件: info.py 项目: E-Tahta/sleekxmpp
    def setup(self, xml=None):
        """
        Populate the stanza object using an optional XML object.

        Overrides ElementBase.setup

        Caches identity and feature information.

        Arguments:
            xml -- Use an existing XML object for the stanza's values.
        """
        ElementBase.setup(self, xml)

        self._identities = set([id[0:3] for id in self['identities']])
        self._features = self['features']
示例#4
0
    def setup(self, xml=None):
        """
        Populate the stanza object using an optional XML object.

        Overrides ElementBase.setup

        Caches identity and feature information.

        Arguments:
            xml -- Use an existing XML object for the stanza's values.
        """
        ElementBase.setup(self, xml)

        self._identities = set([id[0:3] for id in self['identities']])
        self._features = self['features']
示例#5
0
    def setup(self, xml=None):
        """
        Populate the stanza object using an optional XML object.

        Overrides ElementBase.setup.

        Sets a default error type and condition, and changes the
        parent stanza's type to 'error'.

        Arguments:
            xml -- Use an existing XML object for the stanza's values.
        """
        # To comply with PEP8, method names now use underscores.
        # Deprecated method names are re-mapped for backwards compatibility.
        self.getCondition = self.get_condition
        self.setCondition = self.set_condition
        self.delCondition = self.del_condition
        self.getText = self.get_text
        self.setText = self.set_text
        self.delText = self.del_text

        if ElementBase.setup(self, xml):
            #If we had to generate XML then set default values.
            self['type'] = 'cancel'
            self['condition'] = 'feature-not-implemented'
        if self.parent is not None:
            self.parent()['type'] = 'error'
示例#6
0
    def setup(self, xml=None):
        """
        Populate the stanza object using an optional XML object.

        Overrides ElementBase.setup.

        Sets a default error type and condition, and changes the
        parent stanza's type to 'error'.

        Arguments:
            xml -- Use an existing XML object for the stanza's values.
        """
        # To comply with PEP8, method names now use underscores.
        # Deprecated method names are re-mapped for backwards compatibility.
        self.getCondition = self.get_condition
        self.setCondition = self.set_condition
        self.delCondition = self.del_condition
        self.getText = self.get_text
        self.setText = self.set_text
        self.delText = self.del_text

        if ElementBase.setup(self, xml):
            #If we had to generate XML then set default values.
            self['type'] = 'cancel'
            self['condition'] = 'feature-not-implemented'
        if self.parent is not None:
            self.parent()['type'] = 'error'
示例#7
0
    def setup(self, xml=None):
        """
        Populate the stanza object using an optional XML object.

        Overrides StanzaBase.setup.

        Arguments:
            xml -- Use an existing XML object for the stanza's values.
        """
        # To comply with PEP8, method names now use underscores.
        # Deprecated method names are re-mapped for backwards compatibility.
        self.setItems = self.set_items
        self.getItems = self.get_items
        self.delItems = self.del_items

        return ElementBase.setup(self, xml)
示例#8
0
    def setup(self, xml=None):
        """
        Populate the stanza object using an optional XML object.

        Overrides ElementBase.setup.

        Sets a default error type and condition, and changes the
        parent stanza's type to 'error'.

        Arguments:
            xml -- Use an existing XML object for the stanza's values.
        """
        if ElementBase.setup(self, xml):
            #If we had to generate XML then set default values.
            self['type'] = 'cancel'
            self['condition'] = 'feature-not-implemented'
        if self.parent is not None:
            self.parent()['type'] = 'error'
示例#9
0
    def setup(self, xml=None):
        """
        Populate the stanza object using an optional XML object.

        Overrides ElementBase.setup.

        Sets a default error type and condition, and changes the
        parent stanza's type to 'error'.

        Arguments:
            xml -- Use an existing XML object for the stanza's values.
        """
        if ElementBase.setup(self, xml):
            #If we had to generate XML then set default values.
            self['type'] = 'cancel'
            self['condition'] = 'feature-not-implemented'
        if self.parent is not None:
            self.parent()['type'] = 'error'
示例#10
0
 def setup(self, xml=None):
     ElementBase.setup(self, xml)
     self._results = []
示例#11
0
文件: field.py 项目: AmiZya/emesene
 def setup(self, xml=None):
     if ElementBase.setup(self, xml):
         self._type = None
     else:
         self._type = self['type']
示例#12
0
 def setup(self, xml=None):
     ElementBase.setup(self, xml)
示例#13
0
 def setup(self, xml=None):
     if ElementBase.setup(self, xml):
         self._type = None
     else:
         self._type = self['type']
 def setup(self, xml=None):
     ElementBase.setup(self, xml)
     self._credentials = set([credential['type']
                              for credential in self['credentials']])
示例#15
0
文件: qun.py 项目: disda/deepin-talk
 def setup(self, xml=None):
     ElementBase.setup(self, xml)
示例#16
0
 def setup(self, xml=None):
     """
     """
     if ElementBase.setup(self, xml): #if we had to generate xml
         self['type'] = 'form'
示例#17
0
 def setup(self, xml=None):
     if ElementBase.setup(self, xml):
         # If we had to generate xml
         self['type'] = 'form'