XEP-0511: Link Metadata¶
- class slixmpp.plugins.xep_0511.XEP_0511(xmpp, config=None)[source]¶
This plugin add supports for XEP-0511: Link Metadata.
It does not register any stream handler, it just registers stanza interfaces.
- stanza = <module 'slixmpp.plugins.xep_0511.stanza' from '/build/reproducible-path/slixmpp-1.14.1/slixmpp/plugins/xep_0511/stanza.py'>¶
Stanza elements¶
Stanza interfaces for XEP-0511: Link Metadata
Usage:
>>> register_plugin() # automatically done if you use this plugin
>>> msg = Message()
>>> msg["link_metadata"]["about"] = "https://the.link.example.com/what-was-linked-to"
>>> msg["link_metadata"]["title"] = "A cool title"
>>> msg.pretty_print()
<message xmlns="jabber:client">
<Description xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" rdf:about="https://the.link.example.com/what-was-linked-to">
<title xmlns="https://ogp.me/ns#">A cool title</title>
</Description>
</message>
- class slixmpp.plugins.xep_0511.stanza.Description(xml=None, parent=None)[source]¶
- name: ClassVar[str] = 'description'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBaseobject for<message />would usename = 'message'.
- plugin_attrib: ClassVar[str] = 'description'¶
For
ElementBasesubclasses which are intended to be used as plugins, theplugin_attribvalue defines the plugin name. Plugins may be accessed by using theplugin_attribvalue as the interface. An example usingplugin_attrib = 'foo':register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- class slixmpp.plugins.xep_0511.stanza.Image(xml=None, parent=None)[source]¶
- name: ClassVar[str] = 'image'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBaseobject for<message />would usename = 'message'.
- plugin_attrib: ClassVar[str] = 'image'¶
For
ElementBasesubclasses which are intended to be used as plugins, theplugin_attribvalue defines the plugin name. Plugins may be accessed by using theplugin_attribvalue as the interface. An example usingplugin_attrib = 'foo':register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- class slixmpp.plugins.xep_0511.stanza.LinkMetadata(xml=None, parent=None)[source]¶
-
- interfaces: ClassVar[set[str]] = {'about', 'description', 'image', 'site_name', 'title', 'type', 'url'}¶
The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the
plugin_attribvalue of any registered stanza plugins.
- name: ClassVar[str] = 'Description'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBaseobject for<message />would usename = 'message'.
- namespace: str = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'¶
The XML namespace for the element. Given
<foo xmlns="bar" />, thennamespace = "bar"should be used. The default namespace isjabber:clientsince this is being used in an XMPP library.
- plugin_attrib: ClassVar[str] = 'link_metadata'¶
For
ElementBasesubclasses which are intended to be used as plugins, theplugin_attribvalue defines the plugin name. Plugins may be accessed by using theplugin_attribvalue as the interface. An example usingplugin_attrib = 'foo':register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- plugin_multi_attrib: ClassVar[str] = 'link_metadatas'¶
For
ElementBasesubclasses that are intended to be an iterable group of items, theplugin_multi_attribvalue defines an interface for the parent stanza which returns the entire group of matching substanzas. So the following are equivalent:# Given stanza class Foo, with plugin_multi_attrib = 'foos' parent['foos'] filter(isinstance(item, Foo), parent['substanzas'])
- class slixmpp.plugins.xep_0511.stanza.SiteName(xml=None, parent=None)[source]¶
- name: ClassVar[str] = 'site_name'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBaseobject for<message />would usename = 'message'.
- plugin_attrib: ClassVar[str] = 'site_name'¶
For
ElementBasesubclasses which are intended to be used as plugins, theplugin_attribvalue defines the plugin name. Plugins may be accessed by using theplugin_attribvalue as the interface. An example usingplugin_attrib = 'foo':register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- class slixmpp.plugins.xep_0511.stanza.Title(xml=None, parent=None)[source]¶
- name: ClassVar[str] = 'title'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBaseobject for<message />would usename = 'message'.
- plugin_attrib: ClassVar[str] = 'title'¶
For
ElementBasesubclasses which are intended to be used as plugins, theplugin_attribvalue defines the plugin name. Plugins may be accessed by using theplugin_attribvalue as the interface. An example usingplugin_attrib = 'foo':register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- class slixmpp.plugins.xep_0511.stanza.Type_(xml=None, parent=None)[source]¶
- name: ClassVar[str] = 'type'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBaseobject for<message />would usename = 'message'.
- plugin_attrib: ClassVar[str] = 'type'¶
For
ElementBasesubclasses which are intended to be used as plugins, theplugin_attribvalue defines the plugin name. Plugins may be accessed by using theplugin_attribvalue as the interface. An example usingplugin_attrib = 'foo':register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']
- class slixmpp.plugins.xep_0511.stanza.Url(xml=None, parent=None)[source]¶
- name: ClassVar[str] = 'url'¶
The XML tag name of the element, not including any namespace prefixes. For example, an
ElementBaseobject for<message />would usename = 'message'.
- plugin_attrib: ClassVar[str] = 'url'¶
For
ElementBasesubclasses which are intended to be used as plugins, theplugin_attribvalue defines the plugin name. Plugins may be accessed by using theplugin_attribvalue as the interface. An example usingplugin_attrib = 'foo':register_stanza_plugin(Message, FooPlugin) msg = Message() msg['foo']['an_interface_from_the_foo_plugin']