本文整理汇总了Python中twisted.words.xish.domish.Element.attributes["name"]方法的典型用法代码示例。如果您正苦于以下问题:Python Element.attributes["name"]方法的具体用法?Python Element.attributes["name"]怎么用?Python Element.attributes["name"]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.words.xish.domish.Element
的用法示例。
在下文中一共展示了Element.attributes["name"]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: componentConnected
# 需要导入模块: from twisted.words.xish.domish import Element [as 别名]
# 或者: from twisted.words.xish.domish.Element import attributes["name"] [as 别名]
def componentConnected(self, xmlstream):
LogEvent(INFO)
self.xmlstream = xmlstream
self.xmlstream.addObserver("/iq", self.iq.onIq)
self.xmlstream.addObserver("/presence", self.onPresence)
self.xmlstream.addObserver("/message", self.onMessage)
self.xmlstream.addObserver("/bind", self.onBind)
self.xmlstream.addObserver("/route", self.onRouteMessage)
self.xmlstream.addObserver("/error[@xmlns='http://etherx.jabber.org/streams']", self.streamError)
if config.useXCP and config.compjid:
pres = Element((None, "presence"))
pres.attributes["to"] = "[email protected]"
pres.attributes["from"] = config.compjid
x = pres.addElement("x")
x.attributes["xmlns"] = globals.COMPPRESENCE
x.attributes["xmlns:config"] = globals.CONFIG
x.attributes["config:version"] = "1"
x.attributes["protocol-version"] = "1.0"
x.attributes["config-ns"] = legacy.url + "/component"
self.send(pres)
if config.useComponentBinding:
LogEvent(INFO, msg="Component binding to %r" % config.jid)
bind = Element((None,"bind"))
bind.attributes["name"] = config.jid
self.send(bind)
if config.useRouteWrap:
self.routewrap = 1
self.sendInvitations()