本文整理匯總了Python中slixmpp.xmlstream.StanzaBase.setup方法的典型用法代碼示例。如果您正苦於以下問題:Python StanzaBase.setup方法的具體用法?Python StanzaBase.setup怎麽用?Python StanzaBase.setup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類slixmpp.xmlstream.StanzaBase
的用法示例。
在下文中一共展示了StanzaBase.setup方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: setup
# 需要導入模塊: from slixmpp.xmlstream import StanzaBase [as 別名]
# 或者: from slixmpp.xmlstream.StanzaBase import setup [as 別名]
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.
"""
# StanzaBase overrides self.namespace
self.namespace = Failure.namespace
if StanzaBase.setup(self, xml):
#If we had to generate XML then set default values.
self['condition'] = 'not-authorized'
self.xml.tag = self.tag_name()
示例2: setup
# 需要導入模塊: from slixmpp.xmlstream import StanzaBase [as 別名]
# 或者: from slixmpp.xmlstream.StanzaBase import setup [as 別名]
def setup(self, xml):
StanzaBase.setup(self, xml)
self.xml.tag = self.tag_name()
示例3: setup
# 需要導入模塊: from slixmpp.xmlstream import StanzaBase [as 別名]
# 或者: from slixmpp.xmlstream.StanzaBase import setup [as 別名]
def setup(self, xml):
StanzaBase.setup(self, xml)
self.values = self.values