def __init__(self, *args, **kwargs): """ Initialize a new <message /> stanza with an optional 'id' value. Overrides StanzaBase.__init__. """ StanzaBase.__init__(self, *args, **kwargs) if self['id'] == '': if self.stream is not None and self.stream.use_message_ids: self['id'] = self.stream.new_id()
def __init__(self, *args, **kwargs): """ Initialize a new <presence /> stanza with an optional 'id' value. Overrides StanzaBase.__init__. """ StanzaBase.__init__(self, *args, **kwargs) if self['id'] == '': if self.stream is not None and self.stream.use_presence_ids: self['id'] = self.stream.new_id()
def __init__(self, *args, **kwargs): """ Initialize a new <iq> stanza with an 'id' value. Overrides StanzaBase.__init__. """ StanzaBase.__init__(self, *args, **kwargs) if self['id'] == '': if self.stream is not None: self['id'] = self.stream.new_id() else: self['id'] = '0'
def __init__(self, *args, **kwargs): """ Initialize a new <iq> stanza with an 'id' value. Overrides StanzaBase.__init__. """ StanzaBase.__init__(self, *args, **kwargs) # To comply with PEP8, method names now use underscores. # Deprecated method names are re-mapped for backwards compatibility. self.setPayload = self.set_payload self.getQuery = self.get_query self.setQuery = self.set_query self.delQuery = self.del_query if self['id'] == '': if self.stream is not None: self['id'] = self.stream.getNewId() else: self['id'] = '0'