Ejemplo n.º 1
0
 def __init__(self, *args, **kwargs):
     title = None
     if 'title' in kwargs:
         title = kwargs['title']
         del kwargs['title']
     ElementBase.__init__(self, *args, **kwargs)
     if title is not None:
         self['title'] = title
Ejemplo n.º 2
0
 def __init__(self, *args, **kwargs):
     title = None
     if 'title' in kwargs:
         title = kwargs['title']
         del kwargs['title']
     ElementBase.__init__(self, *args, **kwargs)
     if title is not None:
         self['title'] = title
Ejemplo n.º 3
0
 def setup(self, xml=None):
     ElementBase.setup(self, xml)
     self._form = xep_0004.stanza.Form()
     self._form['type'] = 'submit'
     field = self._form.add_field(var='FORM_TYPE', ftype='hidden',
                          value='urn:xmpp:mam:2')
     self.append(self._form)
     self._results = []
Ejemplo n.º 4
0
    def setup(self, xml: Optional[ET.ElementTree] = None):
        """
        Populate the stanza object using an optional XML object.

        Overrides ElementBase.setup

        Caches item information.

        :param xml: Use an existing XML object for the stanza's values.
        """
        ElementBase.setup(self, xml)
        self._items = {item[0:2] for item in self['items']}
Ejemplo n.º 5
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._timestamps = {ts['value'] for ts in self['timestamps']}
Ejemplo n.º 6
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 = {data['name'] for data in self['datas']}
Ejemplo n.º 7
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 = {data['name'] for data in self['datas']}
Ejemplo n.º 8
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._timestamps = {ts['value'] for ts in self['timestamps']}
Ejemplo n.º 9
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._items = set([item[0:2] for item in self['items']])
Ejemplo n.º 10
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 = {node['nodeId'] for node in self['nodes']}
        self._fields = {field['name'] for field in self['fields']}
Ejemplo n.º 11
0
    def setup(self, xml=None):
        """
        Populate the stanza object using an optional XML object.

        Overrides ElementBase.setup

        Caches identity and feature information.

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

        self._identities = {id[0:3] for id in self['identities']}
        self._features = self['features']
Ejemplo n.º 12
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 = {node['nodeId'] for node in self['nodes']}
        self._fields = {field['name'] for field in self['fields']}
Ejemplo n.º 13
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']
Ejemplo n.º 14
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'
Ejemplo n.º 15
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'
Ejemplo n.º 16
0
 def setup(self, xml=None):
     if ElementBase.setup(self, xml):
         # If we had to generate xml
         self['type'] = 'form'
Ejemplo n.º 17
0
 def setup(self, xml=None):
     if ElementBase.setup(self, xml):
         self._type = None
     else:
         self._type = self['type']
Ejemplo n.º 18
0
 def setup(self, xml=None):
     if ElementBase.setup(self, xml):
         # If we had to generate xml
         self['type'] = 'form'
Ejemplo n.º 19
0
 def __init__(self, xml=None, parent=None):
     ElementBase.__init__(self, xml, parent)
     self._timestamps = set()
Ejemplo n.º 20
0
 def __init__(self, *args, **kwargs):
     ElementBase.__init__(self, *args, **kwargs)
Ejemplo n.º 21
0
 def setup(self, xml=None):
     ElementBase.setup(self, xml)
     self._results = []
Ejemplo n.º 22
0
 def __init__(self, *args, **kwargs):
     ElementBase.__init__(self, *args, **kwargs)
Ejemplo n.º 23
0
 def __init__(self, xml=None, parent=None):
     ElementBase.__init__(self, xml, parent)
     self._nodes = set()
     self._datas = set()
Ejemplo n.º 24
0
 def setup(self, xml=None):
     ElementBase.setup(self, xml)
     self._results: List[Message] = []
Ejemplo n.º 25
0
 def __init__(self, xml=None, parent=None):
     ElementBase.__init__(self, xml, parent)
     self._nodes = set()
     self._datas = set()
Ejemplo n.º 26
0
 def setup(self, xml=None):
     if ElementBase.setup(self, xml):
         self._type = None
     else:
         self._type = self['type']
Ejemplo n.º 27
0
 def __init__(self, xml=None, parent=None):
     ElementBase.__init__(self, xml, parent)
     self._timestamps = set()