本文整理汇总了Python中sleekxmpp.xmlstream.ElementBase类的典型用法代码示例。如果您正苦于以下问题:Python ElementBase类的具体用法?Python ElementBase怎么用?Python ElementBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ElementBase类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
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
开发者ID:mendix,项目名称:SleekXMPP,代码行数:8,代码来源:form.py
示例2: setup
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']])
开发者ID:2M1R,项目名称:SleekXMPP,代码行数:13,代码来源:sensordata.py
示例3: setup
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']
开发者ID:EnerNOC,项目名称:smallfoot-sleekxmpp,代码行数:15,代码来源:info.py
示例4: __init__
def __init__(self, param=None, *args, **kwargs):
'''
Class constructor that builds the manually
the XML of the stanza. This procedure is needed
at the moment to be able to include text into
the stanza root elements, as the default
functionality does not seem to allow that.
After defining the XML body of the stanza,
ElementBase is initiated passing the body of the
stanza as an argument for the `xml` parameter
of the ElementBase class.
'''
ET.register_namespace('', 'intamac:intamacdeviceinfo')
root = ET.Element('{intamac:intamacdeviceinfo}intamacdeviceinfo')
root.text = param
ElementBase.__init__(self, xml=root)
开发者ID:abunuwas,项目名称:XMPPGateway2,代码行数:16,代码来源:custom_stanzas.py
示例5: setup
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'
开发者ID:EnerNOC,项目名称:smallfoot-sleekxmpp,代码行数:27,代码来源:error.py
示例6: __init__
def __init__(self, *args, **kwargs):
"""
"""
ElementBase.__init__(self, *args, **kwargs)
self.field = OrderedDict()
self.addField = self.add_field
self.addReported = self.add_reported
self.addItem = self.add_item
self.setItems = self.set_items
self.delItems = self.del_items
self.getItems = self.get_items
self.getInstructions = self.get_instructions
self.setInstructions = self.set_instructions
self.delInstructions = self.del_instructions
self.getFields = self.get_fields
self.setFields = self.set_fields
self.delFields = self.del_fields
self.getValues = self.get_values
self.setValues = self.set_values
self.getReported = self.get_reported
self.setReported = self.set_reported
self.delReported = self.del_reported
开发者ID:huangdehui2013,项目名称:Kestrel,代码行数:23,代码来源:xep_0004.py
示例7: setup
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)
开发者ID:EnerNOC,项目名称:smallfoot-sleekxmpp,代码行数:16,代码来源:roster.py
示例8: setup
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'
开发者ID:calendar42,项目名称:SleekXMPP--XEP-0080-,代码行数:18,代码来源:error.py
示例9: setup
def setup(self, xml=None):
ElementBase.setup(self, xml)
self._results = []
开发者ID:2M1R,项目名称:SleekXMPP,代码行数:3,代码来源:stanza.py
示例10: __init__
def __init__(self, xml=None, parent=None):
ElementBase.__init__(self, xml, parent);
self._timestamps = set()
开发者ID:2M1R,项目名称:SleekXMPP,代码行数:3,代码来源:sensordata.py
示例11: setup
def setup(self, xml=None):
if ElementBase.setup(self, xml):
self._type = None
else:
self._type = self['type']
开发者ID:AmiZya,项目名称:emesene,代码行数:5,代码来源:field.py
示例12: setup
def setup(self, xml=None):
ElementBase.setup(self, xml)
开发者ID:lovesnow,项目名称:deepin-talk,代码行数:2,代码来源:qun.py
示例13: __init__
def __init__(self, xml=None, parent=None):
ElementBase.__init__(self, xml, parent)
self._includes = set()
self._excludes = set()
self._privileges = set()
开发者ID:spark-hardware-alexuser01,项目名称:xmpp_iot,代码行数:5,代码来源:stanza.py
示例14: setup
def setup(self, xml=None):
ElementBase.setup(self, xml)
self._credentials = set([credential['type']
for credential in self['credentials']])
开发者ID:spark-hardware-alexuser01,项目名称:xmpp_iot,代码行数:4,代码来源:stanza.py
示例15: __init__
def __init__(self, xml=None, parent=None):
ElementBase.__init__(self, xml, parent);
self._nodes = set()
self._datas = set()
开发者ID:2M1R,项目名称:SleekXMPP,代码行数:4,代码来源:control.py
示例16: __init__
def __init__(self, *args, **kwargs):
ElementBase.__init__(self, *args, **kwargs)
开发者ID:2M1R,项目名称:SleekXMPP,代码行数:2,代码来源:pubsub_owner.py
示例17: setup
def setup(self, xml=None):
"""
"""
if ElementBase.setup(self, xml): #if we had to generate xml
self['type'] = 'form'
开发者ID:huangdehui2013,项目名称:Kestrel,代码行数:5,代码来源:xep_0004.py
示例18: __init__
def __init__(self, xml=None, parent=None):
ElementBase.__init__(self, xml, parent)
self._nodes = set()
self._fields = set()
开发者ID:arduino-org,项目名称:ciao-connector-xmpp,代码行数:4,代码来源:sensordata.py
注:本文中的sleekxmpp.xmlstream.ElementBase类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论