repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_documentation_string
stringlengths
1
47.2k
func_code_url
stringlengths
85
339
horazont/aioxmpp
aioxmpp/node.py
_try_options
def _try_options(options, exceptions, jid, metadata, negotiation_timeout, loop, logger): """ Helper function for :func:`connect_xmlstream`. """ for host, port, conn in options: logger.debug( "domain %s: trying to connect to %r:%s using %r", jid.domain, ho...
python
def _try_options(options, exceptions, jid, metadata, negotiation_timeout, loop, logger): """ Helper function for :func:`connect_xmlstream`. """ for host, port, conn in options: logger.debug( "domain %s: trying to connect to %r:%s using %r", jid.domain, ho...
Helper function for :func:`connect_xmlstream`.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/node.py#L235-L298
horazont/aioxmpp
aioxmpp/node.py
connect_xmlstream
def connect_xmlstream( jid, metadata, negotiation_timeout=60., override_peer=[], loop=None, logger=logger): """ Prepare and connect a :class:`aioxmpp.protocol.XMLStream` to a server responsible for the given `jid` and authenticate against that server using ...
python
def connect_xmlstream( jid, metadata, negotiation_timeout=60., override_peer=[], loop=None, logger=logger): """ Prepare and connect a :class:`aioxmpp.protocol.XMLStream` to a server responsible for the given `jid` and authenticate against that server using ...
Prepare and connect a :class:`aioxmpp.protocol.XMLStream` to a server responsible for the given `jid` and authenticate against that server using the SASL mechansims described in `metadata`. :param jid: Address of the user for which the connection is made. :type jid: :class:`aioxmpp.JID` :param meta...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/node.py#L302-L416
horazont/aioxmpp
aioxmpp/node.py
Client.start
def start(self): """ Start the client. If it is already :attr:`running`, :class:`RuntimeError` is raised. While the client is running, it will try to keep an XMPP connection open to the server associated with :attr:`local_jid`. """ if self.running: ra...
python
def start(self): """ Start the client. If it is already :attr:`running`, :class:`RuntimeError` is raised. While the client is running, it will try to keep an XMPP connection open to the server associated with :attr:`local_jid`. """ if self.running: ra...
Start the client. If it is already :attr:`running`, :class:`RuntimeError` is raised. While the client is running, it will try to keep an XMPP connection open to the server associated with :attr:`local_jid`.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/node.py#L1041-L1056
horazont/aioxmpp
aioxmpp/node.py
Client.stop
def stop(self): """ Stop the client. This sends a signal to the clients main task which makes it terminate. It may take some cycles through the event loop to stop the client task. To check whether the task has actually stopped, query :attr:`running`. """ ...
python
def stop(self): """ Stop the client. This sends a signal to the clients main task which makes it terminate. It may take some cycles through the event loop to stop the client task. To check whether the task has actually stopped, query :attr:`running`. """ ...
Stop the client. This sends a signal to the clients main task which makes it terminate. It may take some cycles through the event loop to stop the client task. To check whether the task has actually stopped, query :attr:`running`.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/node.py#L1058-L1071
horazont/aioxmpp
aioxmpp/node.py
Client.connected
def connected(self, *, presence=structs.PresenceState(False), **kwargs): """ Return a :class:`.node.UseConnected` context manager which does not modify the presence settings. The keyword arguments are passed to the :class:`.node.UseConnected` context manager constructor. ...
python
def connected(self, *, presence=structs.PresenceState(False), **kwargs): """ Return a :class:`.node.UseConnected` context manager which does not modify the presence settings. The keyword arguments are passed to the :class:`.node.UseConnected` context manager constructor. ...
Return a :class:`.node.UseConnected` context manager which does not modify the presence settings. The keyword arguments are passed to the :class:`.node.UseConnected` context manager constructor. .. versionadded:: 0.8
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/node.py#L1203-L1213
horazont/aioxmpp
aioxmpp/node.py
Client.enqueue
def enqueue(self, stanza, **kwargs): """ Put a `stanza` in the internal transmission queue and return a token to track it. :param stanza: Stanza to send :type stanza: :class:`IQ`, :class:`Message` or :class:`Presence` :param kwargs: see :class:`StanzaToken` :rais...
python
def enqueue(self, stanza, **kwargs): """ Put a `stanza` in the internal transmission queue and return a token to track it. :param stanza: Stanza to send :type stanza: :class:`IQ`, :class:`Message` or :class:`Presence` :param kwargs: see :class:`StanzaToken` :rais...
Put a `stanza` in the internal transmission queue and return a token to track it. :param stanza: Stanza to send :type stanza: :class:`IQ`, :class:`Message` or :class:`Presence` :param kwargs: see :class:`StanzaToken` :raises ConnectionError: if the stream is not :attr:`establish...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/node.py#L1215-L1252
horazont/aioxmpp
aioxmpp/node.py
Client.send
def send(self, stanza, *, timeout=None, cb=None): """ Send a stanza. :param stanza: Stanza to send :type stanza: :class:`~.IQ`, :class:`~.Presence` or :class:`~.Message` :param timeout: Maximum time in seconds to wait for an IQ response, or :data:`None` t...
python
def send(self, stanza, *, timeout=None, cb=None): """ Send a stanza. :param stanza: Stanza to send :type stanza: :class:`~.IQ`, :class:`~.Presence` or :class:`~.Message` :param timeout: Maximum time in seconds to wait for an IQ response, or :data:`None` t...
Send a stanza. :param stanza: Stanza to send :type stanza: :class:`~.IQ`, :class:`~.Presence` or :class:`~.Message` :param timeout: Maximum time in seconds to wait for an IQ response, or :data:`None` to disable the timeout. :type timeout: :class:`~numbers.Real` o...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/node.py#L1255-L1372
horazont/aioxmpp
aioxmpp/node.py
PresenceManagedClient.set_presence
def set_presence(self, state, status): """ Set the presence `state` and `status` on the client. This has the same effects as writing `state` to :attr:`presence`, but the status of the presence is also set at the same time. `status` must be either a string or something which can ...
python
def set_presence(self, state, status): """ Set the presence `state` and `status` on the client. This has the same effects as writing `state` to :attr:`presence`, but the status of the presence is also set at the same time. `status` must be either a string or something which can ...
Set the presence `state` and `status` on the client. This has the same effects as writing `state` to :attr:`presence`, but the status of the presence is also set at the same time. `status` must be either a string or something which can be passed to :class:`dict`. If it is a string, the ...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/node.py#L1472-L1487
horazont/aioxmpp
aioxmpp/im/service.py
ConversationService._add_conversation
def _add_conversation(self, conversation): """ Add the conversation and fire the :meth:`on_conversation_added` event. :param conversation: The conversation object to add. :type conversation: :class:`~.AbstractConversation` The conversation is added to the internal list of conve...
python
def _add_conversation(self, conversation): """ Add the conversation and fire the :meth:`on_conversation_added` event. :param conversation: The conversation object to add. :type conversation: :class:`~.AbstractConversation` The conversation is added to the internal list of conve...
Add the conversation and fire the :meth:`on_conversation_added` event. :param conversation: The conversation object to add. :type conversation: :class:`~.AbstractConversation` The conversation is added to the internal list of conversations which can be queried at :attr:`conversations`....
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/im/service.py#L99-L135
horazont/aioxmpp
aioxmpp/ping/service.py
ping
def ping(client, peer): """ Ping a peer. :param peer: The peer to ping. :type peer: :class:`aioxmpp.JID` :raises aioxmpp.errors.XMPPError: as received Send a :xep:`199` ping IQ to `peer` and wait for the reply. This is a low-level version of :meth:`aioxmpp.PingService.ping`. **When t...
python
def ping(client, peer): """ Ping a peer. :param peer: The peer to ping. :type peer: :class:`aioxmpp.JID` :raises aioxmpp.errors.XMPPError: as received Send a :xep:`199` ping IQ to `peer` and wait for the reply. This is a low-level version of :meth:`aioxmpp.PingService.ping`. **When t...
Ping a peer. :param peer: The peer to ping. :type peer: :class:`aioxmpp.JID` :raises aioxmpp.errors.XMPPError: as received Send a :xep:`199` ping IQ to `peer` and wait for the reply. This is a low-level version of :meth:`aioxmpp.PingService.ping`. **When to use this function vs. the service ...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/ping/service.py#L90-L124
horazont/aioxmpp
aioxmpp/shim/service.py
SHIMService.register_header
def register_header(self, name): """ Register support for the SHIM header with the given `name`. If the header has already been registered as supported, :class:`ValueError` is raised. """ self._node.register_feature( "#".join([namespaces.xep0131_shim, name])...
python
def register_header(self, name): """ Register support for the SHIM header with the given `name`. If the header has already been registered as supported, :class:`ValueError` is raised. """ self._node.register_feature( "#".join([namespaces.xep0131_shim, name])...
Register support for the SHIM header with the given `name`. If the header has already been registered as supported, :class:`ValueError` is raised.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/shim/service.py#L71-L81
horazont/aioxmpp
aioxmpp/shim/service.py
SHIMService.unregister_header
def unregister_header(self, name): """ Unregister support for the SHIM header with the given `name`. If the header is currently not registered as supported, :class:`KeyError` is raised. """ self._node.unregister_feature( "#".join([namespaces.xep0131_shim, na...
python
def unregister_header(self, name): """ Unregister support for the SHIM header with the given `name`. If the header is currently not registered as supported, :class:`KeyError` is raised. """ self._node.unregister_feature( "#".join([namespaces.xep0131_shim, na...
Unregister support for the SHIM header with the given `name`. If the header is currently not registered as supported, :class:`KeyError` is raised.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/shim/service.py#L83-L93
horazont/aioxmpp
aioxmpp/vcard/service.py
VCardService.get_vcard
def get_vcard(self, jid=None): """ Get the vCard stored for the jid `jid`. If `jid` is :data:`None` get the vCard of the connected entity. :param jid: the object to retrieve. :returns: the stored vCard. We mask a :class:`XMPPCancelError` in case it is ``feature-...
python
def get_vcard(self, jid=None): """ Get the vCard stored for the jid `jid`. If `jid` is :data:`None` get the vCard of the connected entity. :param jid: the object to retrieve. :returns: the stored vCard. We mask a :class:`XMPPCancelError` in case it is ``feature-...
Get the vCard stored for the jid `jid`. If `jid` is :data:`None` get the vCard of the connected entity. :param jid: the object to retrieve. :returns: the stored vCard. We mask a :class:`XMPPCancelError` in case it is ``feature-not-implemented`` or ``item-not-found`` and return ...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/vcard/service.py#L40-L68
horazont/aioxmpp
aioxmpp/vcard/service.py
VCardService.set_vcard
def set_vcard(self, vcard): """ Store the vCard `vcard` for the connected entity. :param vcard: the vCard to store. .. note:: `vcard` should always be derived from the result of `get_vcard` to preserve the elements of the vcard the client does not modi...
python
def set_vcard(self, vcard): """ Store the vCard `vcard` for the connected entity. :param vcard: the vCard to store. .. note:: `vcard` should always be derived from the result of `get_vcard` to preserve the elements of the vcard the client does not modi...
Store the vCard `vcard` for the connected entity. :param vcard: the vCard to store. .. note:: `vcard` should always be derived from the result of `get_vcard` to preserve the elements of the vcard the client does not modify. .. warning:: It is in t...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/vcard/service.py#L71-L92
horazont/aioxmpp
aioxmpp/chatstates/utils.py
ChatStateManager.handle
def handle(self, state, message=False): """ Handle a state update. :param state: the new chat state :type state: :class:`~aioxmpp.chatstates.ChatState` :param message: pass true to indicate that we handle the :data:`ACTIVE` state that is implied by ...
python
def handle(self, state, message=False): """ Handle a state update. :param state: the new chat state :type state: :class:`~aioxmpp.chatstates.ChatState` :param message: pass true to indicate that we handle the :data:`ACTIVE` state that is implied by ...
Handle a state update. :param state: the new chat state :type state: :class:`~aioxmpp.chatstates.ChatState` :param message: pass true to indicate that we handle the :data:`ACTIVE` state that is implied by sending a content message. :type ...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/chatstates/utils.py#L111-L139
horazont/aioxmpp
aioxmpp/stanza.py
make_application_error
def make_application_error(name, tag): """ Create and return a **class** inheriting from :class:`.xso.XSO`. The :attr:`.xso.XSO.TAG` is set to `tag` and the class’ name will be `name`. In addition, the class is automatically registered with :attr:`.Error.application_condition` using :meth:`~.Er...
python
def make_application_error(name, tag): """ Create and return a **class** inheriting from :class:`.xso.XSO`. The :attr:`.xso.XSO.TAG` is set to `tag` and the class’ name will be `name`. In addition, the class is automatically registered with :attr:`.Error.application_condition` using :meth:`~.Er...
Create and return a **class** inheriting from :class:`.xso.XSO`. The :attr:`.xso.XSO.TAG` is set to `tag` and the class’ name will be `name`. In addition, the class is automatically registered with :attr:`.Error.application_condition` using :meth:`~.Error.as_application_condition`. Keep in mind th...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/stanza.py#L1037-L1057
horazont/aioxmpp
aioxmpp/stanza.py
Error.from_exception
def from_exception(cls, exc): """ Construct a new :class:`Error` payload from the attributes of the exception. :param exc: The exception to convert :type exc: :class:`aioxmpp.errors.XMPPError` :result: Newly constructed error payload :rtype: :class:`Error` ...
python
def from_exception(cls, exc): """ Construct a new :class:`Error` payload from the attributes of the exception. :param exc: The exception to convert :type exc: :class:`aioxmpp.errors.XMPPError` :result: Newly constructed error payload :rtype: :class:`Error` ...
Construct a new :class:`Error` payload from the attributes of the exception. :param exc: The exception to convert :type exc: :class:`aioxmpp.errors.XMPPError` :result: Newly constructed error payload :rtype: :class:`Error` .. versionchanged:: 0.10 The :attr...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/stanza.py#L356-L377
horazont/aioxmpp
aioxmpp/stanza.py
Error.to_exception
def to_exception(self): """ Convert the error payload to a :class:`~aioxmpp.errors.XMPPError` subclass. :result: Newly constructed exception :rtype: :class:`aioxmpp.errors.XMPPError` The exact type of the result depends on the :attr:`type_` (see :class:`~aioxmpp...
python
def to_exception(self): """ Convert the error payload to a :class:`~aioxmpp.errors.XMPPError` subclass. :result: Newly constructed exception :rtype: :class:`aioxmpp.errors.XMPPError` The exact type of the result depends on the :attr:`type_` (see :class:`~aioxmpp...
Convert the error payload to a :class:`~aioxmpp.errors.XMPPError` subclass. :result: Newly constructed exception :rtype: :class:`aioxmpp.errors.XMPPError` The exact type of the result depends on the :attr:`type_` (see :class:`~aioxmpp.errors.XMPPError` about the existing subcla...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/stanza.py#L379-L403
horazont/aioxmpp
aioxmpp/stanza.py
StanzaBase.autoset_id
def autoset_id(self): """ If the :attr:`id_` already has a non-false (false is also the empty string!) value, this method is a no-op. Otherwise, the :attr:`id_` attribute is filled with :data:`RANDOM_ID_BYTES` of random data, encoded by :func:`aioxmpp.utils.to_nmtoken`. ...
python
def autoset_id(self): """ If the :attr:`id_` already has a non-false (false is also the empty string!) value, this method is a no-op. Otherwise, the :attr:`id_` attribute is filled with :data:`RANDOM_ID_BYTES` of random data, encoded by :func:`aioxmpp.utils.to_nmtoken`. ...
If the :attr:`id_` already has a non-false (false is also the empty string!) value, this method is a no-op. Otherwise, the :attr:`id_` attribute is filled with :data:`RANDOM_ID_BYTES` of random data, encoded by :func:`aioxmpp.utils.to_nmtoken`. .. note:: This method...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/stanza.py#L502-L524
horazont/aioxmpp
aioxmpp/stanza.py
StanzaBase.make_error
def make_error(self, error): """ Create a new instance of this stanza (this directly uses ``type(self)``, so also works for subclasses without extra care) which has the given `error` value set as :attr:`error`. In addition, the :attr:`id_`, :attr:`from_` and :attr:`to` values ar...
python
def make_error(self, error): """ Create a new instance of this stanza (this directly uses ``type(self)``, so also works for subclasses without extra care) which has the given `error` value set as :attr:`error`. In addition, the :attr:`id_`, :attr:`from_` and :attr:`to` values ar...
Create a new instance of this stanza (this directly uses ``type(self)``, so also works for subclasses without extra care) which has the given `error` value set as :attr:`error`. In addition, the :attr:`id_`, :attr:`from_` and :attr:`to` values are transferred from the original (with fro...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/stanza.py#L533-L551
horazont/aioxmpp
aioxmpp/stanza.py
Message.make_reply
def make_reply(self): """ Create a reply for the message. The :attr:`id_` attribute is cleared in the reply. The :attr:`from_` and :attr:`to` are swapped and the :attr:`type_` attribute is the same as the one of the original message. The new :class:`Message` object is re...
python
def make_reply(self): """ Create a reply for the message. The :attr:`id_` attribute is cleared in the reply. The :attr:`from_` and :attr:`to` are swapped and the :attr:`type_` attribute is the same as the one of the original message. The new :class:`Message` object is re...
Create a reply for the message. The :attr:`id_` attribute is cleared in the reply. The :attr:`from_` and :attr:`to` are swapped and the :attr:`type_` attribute is the same as the one of the original message. The new :class:`Message` object is returned.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/stanza.py#L729-L740
horazont/aioxmpp
aioxmpp/protocol.py
XMLStream.close
def close(self): """ Close the XML stream and the underlying transport. This gracefully shuts down the XML stream and the transport, if possible by writing the eof using :meth:`asyncio.Transport.write_eof` after sending the stream footer. After a call to :meth:`close`, ...
python
def close(self): """ Close the XML stream and the underlying transport. This gracefully shuts down the XML stream and the transport, if possible by writing the eof using :meth:`asyncio.Transport.write_eof` after sending the stream footer. After a call to :meth:`close`, ...
Close the XML stream and the underlying transport. This gracefully shuts down the XML stream and the transport, if possible by writing the eof using :meth:`asyncio.Transport.write_eof` after sending the stream footer. After a call to :meth:`close`, no other stream manipulating or sendi...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/protocol.py#L539-L565
horazont/aioxmpp
aioxmpp/protocol.py
XMLStream.reset
def reset(self): """ Reset the stream by discarding all state and re-sending the stream header. Calling :meth:`reset` when the stream is disconnected or currently disconnecting results in either :class:`ConnectionError` being raised or the exception which caused the stre...
python
def reset(self): """ Reset the stream by discarding all state and re-sending the stream header. Calling :meth:`reset` when the stream is disconnected or currently disconnecting results in either :class:`ConnectionError` being raised or the exception which caused the stre...
Reset the stream by discarding all state and re-sending the stream header. Calling :meth:`reset` when the stream is disconnected or currently disconnecting results in either :class:`ConnectionError` being raised or the exception which caused the stream to die (possibly a received ...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/protocol.py#L613-L632
horazont/aioxmpp
aioxmpp/protocol.py
XMLStream.abort
def abort(self): """ Abort the stream by writing an EOF if possible and closing the transport. The transport is closed using :meth:`asyncio.BaseTransport.close`, so buffered data is sent, but no more data will be received. The stream is in :attr:`State.CLOSED` state afte...
python
def abort(self): """ Abort the stream by writing an EOF if possible and closing the transport. The transport is closed using :meth:`asyncio.BaseTransport.close`, so buffered data is sent, but no more data will be received. The stream is in :attr:`State.CLOSED` state afte...
Abort the stream by writing an EOF if possible and closing the transport. The transport is closed using :meth:`asyncio.BaseTransport.close`, so buffered data is sent, but no more data will be received. The stream is in :attr:`State.CLOSED` state afterwards. This also works if t...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/protocol.py#L634-L657
horazont/aioxmpp
aioxmpp/protocol.py
XMLStream.starttls
def starttls(self, ssl_context, post_handshake_callback=None): """ Start TLS on the transport and wait for it to complete. The `ssl_context` and `post_handshake_callback` arguments are forwarded to the transports :meth:`aioopenssl.STARTTLSTransport.starttls` coroutine method. ...
python
def starttls(self, ssl_context, post_handshake_callback=None): """ Start TLS on the transport and wait for it to complete. The `ssl_context` and `post_handshake_callback` arguments are forwarded to the transports :meth:`aioopenssl.STARTTLSTransport.starttls` coroutine method. ...
Start TLS on the transport and wait for it to complete. The `ssl_context` and `post_handshake_callback` arguments are forwarded to the transports :meth:`aioopenssl.STARTTLSTransport.starttls` coroutine method. If the transport does not support starttls, :class:`RuntimeError` is ...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/protocol.py#L699-L722
horazont/aioxmpp
aioxmpp/protocol.py
XMLStream.error_future
def error_future(self): """ Return a future which will receive the next XML stream error as exception. It is safe to cancel the future at any time. """ fut = asyncio.Future(loop=self._loop) self._error_futures.append(fut) return fut
python
def error_future(self): """ Return a future which will receive the next XML stream error as exception. It is safe to cancel the future at any time. """ fut = asyncio.Future(loop=self._loop) self._error_futures.append(fut) return fut
Return a future which will receive the next XML stream error as exception. It is safe to cancel the future at any time.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/protocol.py#L724-L733
horazont/aioxmpp
aioxmpp/pubsub/service.py
PubSubClient.get_features
def get_features(self, jid): """ Return the features supported by a service. :param jid: Address of the PubSub service to query. :type jid: :class:`aioxmpp.JID` :return: Set of supported features :rtype: set containing :class:`~.pubsub.xso.Feature` enumeration ...
python
def get_features(self, jid): """ Return the features supported by a service. :param jid: Address of the PubSub service to query. :type jid: :class:`aioxmpp.JID` :return: Set of supported features :rtype: set containing :class:`~.pubsub.xso.Feature` enumeration ...
Return the features supported by a service. :param jid: Address of the PubSub service to query. :type jid: :class:`aioxmpp.JID` :return: Set of supported features :rtype: set containing :class:`~.pubsub.xso.Feature` enumeration members. This simply uses service ...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pubsub/service.py#L274-L300
horazont/aioxmpp
aioxmpp/pubsub/service.py
PubSubClient.subscribe
def subscribe(self, jid, node=None, *, subscription_jid=None, config=None): """ Subscribe to a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to subscribe to. :type...
python
def subscribe(self, jid, node=None, *, subscription_jid=None, config=None): """ Subscribe to a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to subscribe to. :type...
Subscribe to a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to subscribe to. :type node: :class:`str` :param subscription_jid: The address to subscribe to the service. :type subscription_jid: :class...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pubsub/service.py#L303-L354
horazont/aioxmpp
aioxmpp/pubsub/service.py
PubSubClient.unsubscribe
def unsubscribe(self, jid, node=None, *, subscription_jid=None, subid=None): """ Unsubscribe from a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to unsubscribe from. ...
python
def unsubscribe(self, jid, node=None, *, subscription_jid=None, subid=None): """ Unsubscribe from a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to unsubscribe from. ...
Unsubscribe from a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to unsubscribe from. :type node: :class:`str` :param subscription_jid: The address to subscribe from the service. :type subscription_j...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pubsub/service.py#L357-L390
horazont/aioxmpp
aioxmpp/pubsub/service.py
PubSubClient.get_subscription_config
def get_subscription_config(self, jid, node=None, *, subscription_jid=None, subid=None): """ Request the current configuration of a subscription. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` ...
python
def get_subscription_config(self, jid, node=None, *, subscription_jid=None, subid=None): """ Request the current configuration of a subscription. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` ...
Request the current configuration of a subscription. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to query. :type node: :class:`str` :param subscription_jid: The address to query the configuration for. :t...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pubsub/service.py#L393-L433
horazont/aioxmpp
aioxmpp/pubsub/service.py
PubSubClient.get_default_config
def get_default_config(self, jid, node=None): """ Request the default configuration of a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to query. :type node: :class:`str` :raises aioxmpp.error...
python
def get_default_config(self, jid, node=None): """ Request the default configuration of a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to query. :type node: :class:`str` :raises aioxmpp.error...
Request the default configuration of a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to query. :type node: :class:`str` :raises aioxmpp.errors.XMPPError: as returned by the service :return: The defau...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pubsub/service.py#L480-L504
horazont/aioxmpp
aioxmpp/pubsub/service.py
PubSubClient.get_node_config
def get_node_config(self, jid, node=None): """ Request the configuration of a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to query. :type node: :class:`str` :raises aioxmpp.errors.XMPPError...
python
def get_node_config(self, jid, node=None): """ Request the configuration of a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to query. :type node: :class:`str` :raises aioxmpp.errors.XMPPError...
Request the configuration of a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to query. :type node: :class:`str` :raises aioxmpp.errors.XMPPError: as returned by the service :return: The configuration...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pubsub/service.py#L507-L531
horazont/aioxmpp
aioxmpp/pubsub/service.py
PubSubClient.set_node_config
def set_node_config(self, jid, config, node=None): """ Update the configuration of a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param config: Configuration form :type config: :class:`aioxmpp.forms.Data` :param node: Name of ...
python
def set_node_config(self, jid, config, node=None): """ Update the configuration of a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param config: Configuration form :type config: :class:`aioxmpp.forms.Data` :param node: Name of ...
Update the configuration of a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param config: Configuration form :type config: :class:`aioxmpp.forms.Data` :param node: Name of the PubSub node to query. :type node: :class:`str` :rai...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pubsub/service.py#L534-L559
horazont/aioxmpp
aioxmpp/pubsub/service.py
PubSubClient.get_items
def get_items(self, jid, node, *, max_items=None): """ Request the most recent items from a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to query. :type node: :class:`str` :param max_items: ...
python
def get_items(self, jid, node, *, max_items=None): """ Request the most recent items from a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to query. :type node: :class:`str` :param max_items: ...
Request the most recent items from a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to query. :type node: :class:`str` :param max_items: Number of items to return at most. :type max_items: :class:`int...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pubsub/service.py#L562-L589
horazont/aioxmpp
aioxmpp/pubsub/service.py
PubSubClient.get_items_by_id
def get_items_by_id(self, jid, node, ids): """ Request specific items by their IDs from a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to query. :type node: :class:`str` :param ids: The item...
python
def get_items_by_id(self, jid, node, ids): """ Request specific items by their IDs from a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to query. :type node: :class:`str` :param ids: The item...
Request specific items by their IDs from a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to query. :type node: :class:`str` :param ids: The item IDs to return. :type ids: :class:`~collections.abc.Ite...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pubsub/service.py#L592-L628
horazont/aioxmpp
aioxmpp/pubsub/service.py
PubSubClient.get_subscriptions
def get_subscriptions(self, jid, node=None): """ Return all subscriptions of the local entity to a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to query. :type node: :class:`str` :raises aio...
python
def get_subscriptions(self, jid, node=None): """ Return all subscriptions of the local entity to a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to query. :type node: :class:`str` :raises aio...
Return all subscriptions of the local entity to a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to query. :type node: :class:`str` :raises aioxmpp.errors.XMPPError: as returned by the service :return...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pubsub/service.py#L631-L653
horazont/aioxmpp
aioxmpp/pubsub/service.py
PubSubClient.publish
def publish(self, jid, node, payload, *, id_=None, publish_options=None): """ Publish an item to a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to publish to. :type n...
python
def publish(self, jid, node, payload, *, id_=None, publish_options=None): """ Publish an item to a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to publish to. :type n...
Publish an item to a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to publish to. :type node: :class:`str` :param payload: Registered payload to publish. :type payload: :class:`aioxmpp.xso.XSO` ...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pubsub/service.py#L656-L730
horazont/aioxmpp
aioxmpp/pubsub/service.py
PubSubClient.retract
def retract(self, jid, node, id_, *, notify=False): """ Retract a previously published item from a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to send a notify from. :type node: :class:`str` ...
python
def retract(self, jid, node, id_, *, notify=False): """ Retract a previously published item from a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to send a notify from. :type node: :class:`str` ...
Retract a previously published item from a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to send a notify from. :type node: :class:`str` :param id_: The ID of the item to retract. :type id_: :class:`...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pubsub/service.py#L749-L782
horazont/aioxmpp
aioxmpp/pubsub/service.py
PubSubClient.create
def create(self, jid, node=None): """ Create a new node at a service. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to create. :type node: :class:`str` or :data:`None` :raises aioxmpp.errors.XMPPEr...
python
def create(self, jid, node=None): """ Create a new node at a service. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to create. :type node: :class:`str` or :data:`None` :raises aioxmpp.errors.XMPPEr...
Create a new node at a service. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to create. :type node: :class:`str` or :data:`None` :raises aioxmpp.errors.XMPPError: as returned by the service :return: The n...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pubsub/service.py#L785-L817
horazont/aioxmpp
aioxmpp/pubsub/service.py
PubSubClient.delete
def delete(self, jid, node, *, redirect_uri=None): """ Delete an existing node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to delete. :type node: :class:`str` or :data:`None` :param redirect_uri...
python
def delete(self, jid, node, *, redirect_uri=None): """ Delete an existing node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to delete. :type node: :class:`str` or :data:`None` :param redirect_uri...
Delete an existing node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the PubSub node to delete. :type node: :class:`str` or :data:`None` :param redirect_uri: A URI to send to subscribers to indicate a replacement fo...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pubsub/service.py#L820-L849
horazont/aioxmpp
aioxmpp/pubsub/service.py
PubSubClient.get_nodes
def get_nodes(self, jid, node=None): """ Request all nodes at a service or collection node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the collection node to query :type node: :class:`str` or :data:`None` :rais...
python
def get_nodes(self, jid, node=None): """ Request all nodes at a service or collection node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the collection node to query :type node: :class:`str` or :data:`None` :rais...
Request all nodes at a service or collection node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the collection node to query :type node: :class:`str` or :data:`None` :raises aioxmpp.errors.XMPPError: as returned by the service ...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pubsub/service.py#L852-L891
horazont/aioxmpp
aioxmpp/pubsub/service.py
PubSubClient.get_node_affiliations
def get_node_affiliations(self, jid, node): """ Return the affiliations of other jids at a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the node to query :type node: :class:`str` :raises aioxmpp.errors.XMPP...
python
def get_node_affiliations(self, jid, node): """ Return the affiliations of other jids at a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the node to query :type node: :class:`str` :raises aioxmpp.errors.XMPP...
Return the affiliations of other jids at a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the node to query :type node: :class:`str` :raises aioxmpp.errors.XMPPError: as returned by the service :return: The response ...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pubsub/service.py#L894-L918
horazont/aioxmpp
aioxmpp/pubsub/service.py
PubSubClient.change_node_affiliations
def change_node_affiliations(self, jid, node, affiliations_to_set): """ Update the affiliations at a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the node to modify :type node: :class:`str` :param affiliati...
python
def change_node_affiliations(self, jid, node, affiliations_to_set): """ Update the affiliations at a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the node to modify :type node: :class:`str` :param affiliati...
Update the affiliations at a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the node to modify :type node: :class:`str` :param affiliations_to_set: The affiliations to set at the node. :type affiliations_to_set: :cla...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pubsub/service.py#L948-L982
horazont/aioxmpp
aioxmpp/pubsub/service.py
PubSubClient.change_node_subscriptions
def change_node_subscriptions(self, jid, node, subscriptions_to_set): """ Update the subscriptions at a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the node to modify :type node: :class:`str` :param subscr...
python
def change_node_subscriptions(self, jid, node, subscriptions_to_set): """ Update the subscriptions at a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the node to modify :type node: :class:`str` :param subscr...
Update the subscriptions at a node. :param jid: Address of the PubSub service. :type jid: :class:`aioxmpp.JID` :param node: Name of the node to modify :type node: :class:`str` :param subscriptions_to_set: The subscriptions to set at the node. :type subscriptions_to_set: ...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pubsub/service.py#L985-L1020
horazont/aioxmpp
aioxmpp/pubsub/service.py
PubSubClient.purge
def purge(self, jid, node): """ Delete all items from a node. :param jid: JID of the PubSub service :param node: Name of the PubSub node :type node: :class:`str` Requires :attr:`.xso.Feature.PURGE`. """ iq = aioxmpp.stanza.IQ( type_=aioxmpp....
python
def purge(self, jid, node): """ Delete all items from a node. :param jid: JID of the PubSub service :param node: Name of the PubSub node :type node: :class:`str` Requires :attr:`.xso.Feature.PURGE`. """ iq = aioxmpp.stanza.IQ( type_=aioxmpp....
Delete all items from a node. :param jid: JID of the PubSub service :param node: Name of the PubSub node :type node: :class:`str` Requires :attr:`.xso.Feature.PURGE`.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pubsub/service.py#L1023-L1044
horazont/aioxmpp
aioxmpp/xso/model.py
capture_events
def capture_events(receiver, dest): """ Capture all events sent to `receiver` in the sequence `dest`. This is a generator, and it is best used with ``yield from``. The observable effect of using this generator with ``yield from`` is identical to the effect of using `receiver` with ``yield from`` dir...
python
def capture_events(receiver, dest): """ Capture all events sent to `receiver` in the sequence `dest`. This is a generator, and it is best used with ``yield from``. The observable effect of using this generator with ``yield from`` is identical to the effect of using `receiver` with ``yield from`` dir...
Capture all events sent to `receiver` in the sequence `dest`. This is a generator, and it is best used with ``yield from``. The observable effect of using this generator with ``yield from`` is identical to the effect of using `receiver` with ``yield from`` directly (including the return value), but in a...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L2616-L2678
horazont/aioxmpp
aioxmpp/xso/model.py
events_to_sax
def events_to_sax(events, dest): """ Convert an iterable `events` of XSO events to SAX events by calling the matching SAX methods on `dest` """ name_stack = [] for ev_type, *ev_args in events: if ev_type == "start": name = (ev_args[0], ev_args[1]) dest.startEleme...
python
def events_to_sax(events, dest): """ Convert an iterable `events` of XSO events to SAX events by calling the matching SAX methods on `dest` """ name_stack = [] for ev_type, *ev_args in events: if ev_type == "start": name = (ev_args[0], ev_args[1]) dest.startEleme...
Convert an iterable `events` of XSO events to SAX events by calling the matching SAX methods on `dest`
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L2681-L2697
horazont/aioxmpp
aioxmpp/xso/model.py
XSOList.filter
def filter(self, *, type_=None, lang=None, attrs={}): """ Return an iterable which produces a sequence of the elements inside this :class:`XSOList`, filtered by the criteria given as arguments. The function starts with a working sequence consisting of the whole list. If `type_` ...
python
def filter(self, *, type_=None, lang=None, attrs={}): """ Return an iterable which produces a sequence of the elements inside this :class:`XSOList`, filtered by the criteria given as arguments. The function starts with a working sequence consisting of the whole list. If `type_` ...
Return an iterable which produces a sequence of the elements inside this :class:`XSOList`, filtered by the criteria given as arguments. The function starts with a working sequence consisting of the whole list. If `type_` is not :data:`None`, elements which are not an instance of the giv...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L213-L260
horazont/aioxmpp
aioxmpp/xso/model.py
XSOList.filtered
def filtered(self, *, type_=None, lang=None, attrs={}): """ This method is a convencience wrapper around :meth:`filter` which evaluates the result into a list and returns that list. """ return list(self.filter(type_=type_, lang=lang, attrs=attrs))
python
def filtered(self, *, type_=None, lang=None, attrs={}): """ This method is a convencience wrapper around :meth:`filter` which evaluates the result into a list and returns that list. """ return list(self.filter(type_=type_, lang=lang, attrs=attrs))
This method is a convencience wrapper around :meth:`filter` which evaluates the result into a list and returns that list.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L262-L267
horazont/aioxmpp
aioxmpp/xso/model.py
Text.from_value
def from_value(self, instance, value): """ Convert the given value using the set `type_` and store it into `instance`’ attribute. """ try: parsed = self.type_.parse(value) except (TypeError, ValueError): if self.erroneous_as_absent: ...
python
def from_value(self, instance, value): """ Convert the given value using the set `type_` and store it into `instance`’ attribute. """ try: parsed = self.type_.parse(value) except (TypeError, ValueError): if self.erroneous_as_absent: ...
Convert the given value using the set `type_` and store it into `instance`’ attribute.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L403-L415
horazont/aioxmpp
aioxmpp/xso/model.py
Text.to_sax
def to_sax(self, instance, dest): """ Assign the formatted value stored at `instance`’ attribute to the text of `el`. If the `value` is :data:`None`, no text is generated. """ value = self.__get__(instance, type(instance)) if value is None: return ...
python
def to_sax(self, instance, dest): """ Assign the formatted value stored at `instance`’ attribute to the text of `el`. If the `value` is :data:`None`, no text is generated. """ value = self.__get__(instance, type(instance)) if value is None: return ...
Assign the formatted value stored at `instance`’ attribute to the text of `el`. If the `value` is :data:`None`, no text is generated.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L417-L427
horazont/aioxmpp
aioxmpp/xso/model.py
Child.from_events
def from_events(self, instance, ev_args, ctx): """ Detect the object to instanciate from the arguments `ev_args` of the ``"start"`` event. The new object is stored at the corresponding descriptor attribute on `instance`. This method is suspendable. """ obj = yiel...
python
def from_events(self, instance, ev_args, ctx): """ Detect the object to instanciate from the arguments `ev_args` of the ``"start"`` event. The new object is stored at the corresponding descriptor attribute on `instance`. This method is suspendable. """ obj = yiel...
Detect the object to instanciate from the arguments `ev_args` of the ``"start"`` event. The new object is stored at the corresponding descriptor attribute on `instance`. This method is suspendable.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L556-L566
horazont/aioxmpp
aioxmpp/xso/model.py
Child.to_sax
def to_sax(self, instance, dest): """ Take the object associated with this descriptor on `instance` and serialize it as child into the given :class:`lxml.etree.Element` `parent`. If the object is :data:`None`, no content is generated. """ obj = self.__get__(insta...
python
def to_sax(self, instance, dest): """ Take the object associated with this descriptor on `instance` and serialize it as child into the given :class:`lxml.etree.Element` `parent`. If the object is :data:`None`, no content is generated. """ obj = self.__get__(insta...
Take the object associated with this descriptor on `instance` and serialize it as child into the given :class:`lxml.etree.Element` `parent`. If the object is :data:`None`, no content is generated.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L576-L587
horazont/aioxmpp
aioxmpp/xso/model.py
ChildList.from_events
def from_events(self, instance, ev_args, ctx): """ Like :meth:`.Child.from_events`, but instead of replacing the attribute value, the new object is appended to the list. """ obj = yield from self._process(instance, ev_args, ctx) self.__get__(instance, type(instance)).app...
python
def from_events(self, instance, ev_args, ctx): """ Like :meth:`.Child.from_events`, but instead of replacing the attribute value, the new object is appended to the list. """ obj = yield from self._process(instance, ev_args, ctx) self.__get__(instance, type(instance)).app...
Like :meth:`.Child.from_events`, but instead of replacing the attribute value, the new object is appended to the list.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L622-L630
horazont/aioxmpp
aioxmpp/xso/model.py
Collector.from_events
def from_events(self, instance, ev_args, ctx): """ Collect the events and convert them to a single XML subtree, which then gets appended to the list at `instance`. `ev_args` must be the arguments of the ``"start"`` event of the new child. This method is suspendable. """ ...
python
def from_events(self, instance, ev_args, ctx): """ Collect the events and convert them to a single XML subtree, which then gets appended to the list at `instance`. `ev_args` must be the arguments of the ``"start"`` event of the new child. This method is suspendable. """ ...
Collect the events and convert them to a single XML subtree, which then gets appended to the list at `instance`. `ev_args` must be the arguments of the ``"start"`` event of the new child. This method is suspendable.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L687-L730
horazont/aioxmpp
aioxmpp/xso/model.py
Attr.handle_missing
def handle_missing(self, instance, ctx): """ Handle a missing attribute on `instance`. This is called whenever no value for the attribute is found during parsing. The call to :meth:`missing` is independent of the value of `required`. If the `missing` callback is not :data:`None`...
python
def handle_missing(self, instance, ctx): """ Handle a missing attribute on `instance`. This is called whenever no value for the attribute is found during parsing. The call to :meth:`missing` is independent of the value of `required`. If the `missing` callback is not :data:`None`...
Handle a missing attribute on `instance`. This is called whenever no value for the attribute is found during parsing. The call to :meth:`missing` is independent of the value of `required`. If the `missing` callback is not :data:`None`, it is called with the `instance` and the `ctx` as a...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L812-L838
horazont/aioxmpp
aioxmpp/xso/model.py
Attr.to_dict
def to_dict(self, instance, d): """ Override the implementation from :class:`Text` by storing the formatted value in the XML attribute instead of the character data. If the value is :data:`None`, no element is generated. """ value = self.__get__(instance, type(instance)...
python
def to_dict(self, instance, d): """ Override the implementation from :class:`Text` by storing the formatted value in the XML attribute instead of the character data. If the value is :data:`None`, no element is generated. """ value = self.__get__(instance, type(instance)...
Override the implementation from :class:`Text` by storing the formatted value in the XML attribute instead of the character data. If the value is :data:`None`, no element is generated.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L850-L862
horazont/aioxmpp
aioxmpp/xso/model.py
ChildText.from_events
def from_events(self, instance, ev_args, ctx): """ Starting with the element to which the start event information in `ev_args` belongs, parse text data. If any children are encountered, :attr:`child_policy` is enforced (see :class:`UnknownChildPolicy`). Likewise, if the start eve...
python
def from_events(self, instance, ev_args, ctx): """ Starting with the element to which the start event information in `ev_args` belongs, parse text data. If any children are encountered, :attr:`child_policy` is enforced (see :class:`UnknownChildPolicy`). Likewise, if the start eve...
Starting with the element to which the start event information in `ev_args` belongs, parse text data. If any children are encountered, :attr:`child_policy` is enforced (see :class:`UnknownChildPolicy`). Likewise, if the start event contains attributes, :attr:`attr_policy` is enforced ...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L943-L988
horazont/aioxmpp
aioxmpp/xso/model.py
ChildText.to_sax
def to_sax(self, instance, dest): """ Create a child node at `parent` with the tag :attr:`tag`. Set the text contents to the value of the attribute which this descriptor represents at `instance`. If the value is :data:`None`, no element is generated. """ value =...
python
def to_sax(self, instance, dest): """ Create a child node at `parent` with the tag :attr:`tag`. Set the text contents to the value of the attribute which this descriptor represents at `instance`. If the value is :data:`None`, no element is generated. """ value =...
Create a child node at `parent` with the tag :attr:`tag`. Set the text contents to the value of the attribute which this descriptor represents at `instance`. If the value is :data:`None`, no element is generated.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L990-L1011
horazont/aioxmpp
aioxmpp/xso/model.py
ChildMap.fill_into_dict
def fill_into_dict(self, items, dest): """ Take an iterable of `items` and group it into the given `dest` dict, using the :attr:`key` function. The `dest` dict must either already contain the keys which are generated by the :attr:`key` function for the items in `items`, or must ...
python
def fill_into_dict(self, items, dest): """ Take an iterable of `items` and group it into the given `dest` dict, using the :attr:`key` function. The `dest` dict must either already contain the keys which are generated by the :attr:`key` function for the items in `items`, or must ...
Take an iterable of `items` and group it into the given `dest` dict, using the :attr:`key` function. The `dest` dict must either already contain the keys which are generated by the :attr:`key` function for the items in `items`, or must default them suitably. The values of the affected k...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L1063-L1075
horazont/aioxmpp
aioxmpp/xso/model.py
ChildMap.from_events
def from_events(self, instance, ev_args, ctx): """ Like :meth:`.ChildList.from_events`, but the object is appended to the list associated with its tag in the dict. """ tag = ev_args[0], ev_args[1] cls = self._tag_map[tag] obj = yield from cls.parse_events(ev_args...
python
def from_events(self, instance, ev_args, ctx): """ Like :meth:`.ChildList.from_events`, but the object is appended to the list associated with its tag in the dict. """ tag = ev_args[0], ev_args[1] cls = self._tag_map[tag] obj = yield from cls.parse_events(ev_args...
Like :meth:`.ChildList.from_events`, but the object is appended to the list associated with its tag in the dict.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L1077-L1087
horazont/aioxmpp
aioxmpp/xso/model.py
XMLStreamClass.parse_events
def parse_events(cls, ev_args, parent_ctx): """ Create an instance of this class, using the events sent into this function. `ev_args` must be the event arguments of the ``"start"`` event. .. seealso:: You probably should not call this method directly, but instead use...
python
def parse_events(cls, ev_args, parent_ctx): """ Create an instance of this class, using the events sent into this function. `ev_args` must be the event arguments of the ``"start"`` event. .. seealso:: You probably should not call this method directly, but instead use...
Create an instance of this class, using the events sent into this function. `ev_args` must be the event arguments of the ``"start"`` event. .. seealso:: You probably should not call this method directly, but instead use :class:`XSOParser` with a :class:`SAXDriver`. ...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L1863-L2000
horazont/aioxmpp
aioxmpp/xso/model.py
XMLStreamClass.register_child
def register_child(cls, prop, child_cls): """ Register a new :class:`XMLStreamClass` instance `child_cls` for a given :class:`Child` descriptor `prop`. .. warning:: This method cannot be used after a class has been derived from this class. This is for consistency:...
python
def register_child(cls, prop, child_cls): """ Register a new :class:`XMLStreamClass` instance `child_cls` for a given :class:`Child` descriptor `prop`. .. warning:: This method cannot be used after a class has been derived from this class. This is for consistency:...
Register a new :class:`XMLStreamClass` instance `child_cls` for a given :class:`Child` descriptor `prop`. .. warning:: This method cannot be used after a class has been derived from this class. This is for consistency: the method modifies the bookkeeping attributes of ...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L2002-L2046
horazont/aioxmpp
aioxmpp/xso/model.py
CapturingXMLStreamClass.parse_events
def parse_events(cls, ev_args, parent_ctx): """ Capture the events sent to :meth:`.XSO.parse_events`, including the initial `ev_args` to a list and call :meth:`_set_captured_events` on the result of :meth:`.XSO.parse_events`. Like the method it overrides, :meth:`parse_ev...
python
def parse_events(cls, ev_args, parent_ctx): """ Capture the events sent to :meth:`.XSO.parse_events`, including the initial `ev_args` to a list and call :meth:`_set_captured_events` on the result of :meth:`.XSO.parse_events`. Like the method it overrides, :meth:`parse_ev...
Capture the events sent to :meth:`.XSO.parse_events`, including the initial `ev_args` to a list and call :meth:`_set_captured_events` on the result of :meth:`.XSO.parse_events`. Like the method it overrides, :meth:`parse_events` is suspendable.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L2065-L2082
horazont/aioxmpp
aioxmpp/xso/model.py
XSOParser.add_class
def add_class(self, cls, callback): """ Add a class `cls` for parsing as root level element. When an object of `cls` type has been completely parsed, `callback` is called with the object as argument. """ if cls.TAG in self._tag_map: raise ValueError( ...
python
def add_class(self, cls, callback): """ Add a class `cls` for parsing as root level element. When an object of `cls` type has been completely parsed, `callback` is called with the object as argument. """ if cls.TAG in self._tag_map: raise ValueError( ...
Add a class `cls` for parsing as root level element. When an object of `cls` type has been completely parsed, `callback` is called with the object as argument.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L2496-L2508
horazont/aioxmpp
aioxmpp/xso/model.py
XSOParser.remove_class
def remove_class(self, cls): """ Remove a XSO class `cls` from parsing. This method raises :class:`KeyError` with the classes :attr:`TAG` attribute as argument if removing fails because the class is not registered. """ del self._tag_map[cls.TAG] del self._class_ma...
python
def remove_class(self, cls): """ Remove a XSO class `cls` from parsing. This method raises :class:`KeyError` with the classes :attr:`TAG` attribute as argument if removing fails because the class is not registered. """ del self._tag_map[cls.TAG] del self._class_ma...
Remove a XSO class `cls` from parsing. This method raises :class:`KeyError` with the classes :attr:`TAG` attribute as argument if removing fails because the class is not registered.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/xso/model.py#L2536-L2543
horazont/aioxmpp
aioxmpp/stringprep.py
check_against_tables
def check_against_tables(chars, tables): """ Perform a check against the table predicates in `tables`. `tables` must be a reusable iterable containing characteristic functions of character sets, that is, functions which return :data:`True` if the character is in the table. The function returns ...
python
def check_against_tables(chars, tables): """ Perform a check against the table predicates in `tables`. `tables` must be a reusable iterable containing characteristic functions of character sets, that is, functions which return :data:`True` if the character is in the table. The function returns ...
Perform a check against the table predicates in `tables`. `tables` must be a reusable iterable containing characteristic functions of character sets, that is, functions which return :data:`True` if the character is in the table. The function returns the first character occuring in any of the tables or ...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/stringprep.py#L55-L70
horazont/aioxmpp
aioxmpp/stringprep.py
check_bidi
def check_bidi(chars): """ Check proper bidirectionality as per stringprep. Operates on a list of unicode characters provided in `chars`. """ # the empty string is valid, as it cannot violate the RandALCat constraints if not chars: return # first_is_RorAL = unicodedata.bidirectiona...
python
def check_bidi(chars): """ Check proper bidirectionality as per stringprep. Operates on a list of unicode characters provided in `chars`. """ # the empty string is valid, as it cannot violate the RandALCat constraints if not chars: return # first_is_RorAL = unicodedata.bidirectiona...
Check proper bidirectionality as per stringprep. Operates on a list of unicode characters provided in `chars`.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/stringprep.py#L81-L104
horazont/aioxmpp
aioxmpp/stringprep.py
check_prohibited_output
def check_prohibited_output(chars, bad_tables): """ Check against prohibited output, by checking whether any of the characters from `chars` are in any of the `bad_tables`. Operates in-place on a list of code points from `chars`. """ violator = check_against_tables(chars, bad_tables) if viol...
python
def check_prohibited_output(chars, bad_tables): """ Check against prohibited output, by checking whether any of the characters from `chars` are in any of the `bad_tables`. Operates in-place on a list of code points from `chars`. """ violator = check_against_tables(chars, bad_tables) if viol...
Check against prohibited output, by checking whether any of the characters from `chars` are in any of the `bad_tables`. Operates in-place on a list of code points from `chars`.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/stringprep.py#L107-L117
horazont/aioxmpp
aioxmpp/stringprep.py
check_unassigned
def check_unassigned(chars, bad_tables): """ Check that `chars` does not contain any unassigned code points as per the given list of `bad_tables`. Operates on a list of unicode code points provided in `chars`. """ bad_tables = ( stringprep.in_table_a1,) violator = check_against_tab...
python
def check_unassigned(chars, bad_tables): """ Check that `chars` does not contain any unassigned code points as per the given list of `bad_tables`. Operates on a list of unicode code points provided in `chars`. """ bad_tables = ( stringprep.in_table_a1,) violator = check_against_tab...
Check that `chars` does not contain any unassigned code points as per the given list of `bad_tables`. Operates on a list of unicode code points provided in `chars`.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/stringprep.py#L120-L133
horazont/aioxmpp
aioxmpp/stringprep.py
nodeprep
def nodeprep(string, allow_unassigned=False): """ Process the given `string` using the Nodeprep (`RFC 6122`_) profile. In the error cases defined in `RFC 3454`_ (stringprep), a :class:`ValueError` is raised. """ chars = list(string) _nodeprep_do_mapping(chars) do_normalization(chars) ...
python
def nodeprep(string, allow_unassigned=False): """ Process the given `string` using the Nodeprep (`RFC 6122`_) profile. In the error cases defined in `RFC 3454`_ (stringprep), a :class:`ValueError` is raised. """ chars = list(string) _nodeprep_do_mapping(chars) do_normalization(chars) ...
Process the given `string` using the Nodeprep (`RFC 6122`_) profile. In the error cases defined in `RFC 3454`_ (stringprep), a :class:`ValueError` is raised.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/stringprep.py#L149-L185
horazont/aioxmpp
aioxmpp/stringprep.py
resourceprep
def resourceprep(string, allow_unassigned=False): """ Process the given `string` using the Resourceprep (`RFC 6122`_) profile. In the error cases defined in `RFC 3454`_ (stringprep), a :class:`ValueError` is raised. """ chars = list(string) _resourceprep_do_mapping(chars) do_normalizati...
python
def resourceprep(string, allow_unassigned=False): """ Process the given `string` using the Resourceprep (`RFC 6122`_) profile. In the error cases defined in `RFC 3454`_ (stringprep), a :class:`ValueError` is raised. """ chars = list(string) _resourceprep_do_mapping(chars) do_normalizati...
Process the given `string` using the Resourceprep (`RFC 6122`_) profile. In the error cases defined in `RFC 3454`_ (stringprep), a :class:`ValueError` is raised.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/stringprep.py#L198-L232
horazont/aioxmpp
aioxmpp/avatar/service.py
AvatarSet.add_avatar_image
def add_avatar_image(self, mime_type, *, id_=None, image_bytes=None, width=None, height=None, url=None, nbytes=None): """ Add a source of the avatar image. All sources of an avatar image added to an avatar set must be *the same image*, i...
python
def add_avatar_image(self, mime_type, *, id_=None, image_bytes=None, width=None, height=None, url=None, nbytes=None): """ Add a source of the avatar image. All sources of an avatar image added to an avatar set must be *the same image*, i...
Add a source of the avatar image. All sources of an avatar image added to an avatar set must be *the same image*, in different formats and sizes. :param mime_type: The MIME type of the avatar image. :param id_: The SHA1 of the image data. :param nbytes: The size of the image da...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/avatar/service.py#L95-L183
horazont/aioxmpp
aioxmpp/avatar/service.py
AvatarService.get_avatar_metadata
def get_avatar_metadata(self, jid, *, require_fresh=False, disable_pep=False): """ Retrieve a list of avatar descriptors. :param jid: the JID for which to retrieve the avatar metadata. :type jid: :class:`aioxmpp.JID` :param require_fresh: if true, do ...
python
def get_avatar_metadata(self, jid, *, require_fresh=False, disable_pep=False): """ Retrieve a list of avatar descriptors. :param jid: the JID for which to retrieve the avatar metadata. :type jid: :class:`aioxmpp.JID` :param require_fresh: if true, do ...
Retrieve a list of avatar descriptors. :param jid: the JID for which to retrieve the avatar metadata. :type jid: :class:`aioxmpp.JID` :param require_fresh: if true, do not return results from the avatar metadata chache, but retrieve them again from the server. :type require_...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/avatar/service.py#L835-L896
horazont/aioxmpp
aioxmpp/avatar/service.py
AvatarService.publish_avatar_set
def publish_avatar_set(self, avatar_set): """ Make `avatar_set` the current avatar of the jid associated with this connection. If :attr:`synchronize_vcard` is true and PEP is available the vCard is only synchronized if the PEP update is successful. This means publishing...
python
def publish_avatar_set(self, avatar_set): """ Make `avatar_set` the current avatar of the jid associated with this connection. If :attr:`synchronize_vcard` is true and PEP is available the vCard is only synchronized if the PEP update is successful. This means publishing...
Make `avatar_set` the current avatar of the jid associated with this connection. If :attr:`synchronize_vcard` is true and PEP is available the vCard is only synchronized if the PEP update is successful. This means publishing the ``image/png`` avatar data and the avatar metadata...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/avatar/service.py#L913-L956
horazont/aioxmpp
aioxmpp/avatar/service.py
AvatarService.disable_avatar
def disable_avatar(self): """ Temporarily disable the avatar. If :attr:`synchronize_vcard` is true, the vCard avatar is disabled (even if disabling the PEP avatar fails). This is done by setting the avatar metadata node empty and if :attr:`synchronize_vcard` is true, do...
python
def disable_avatar(self): """ Temporarily disable the avatar. If :attr:`synchronize_vcard` is true, the vCard avatar is disabled (even if disabling the PEP avatar fails). This is done by setting the avatar metadata node empty and if :attr:`synchronize_vcard` is true, do...
Temporarily disable the avatar. If :attr:`synchronize_vcard` is true, the vCard avatar is disabled (even if disabling the PEP avatar fails). This is done by setting the avatar metadata node empty and if :attr:`synchronize_vcard` is true, downloading the vCard, removing the avat...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/avatar/service.py#L967-L995
horazont/aioxmpp
aioxmpp/avatar/service.py
AvatarService.wipe_avatar
def wipe_avatar(self): """ Remove all avatar data stored on the server. If :attr:`synchronize_vcard` is true, the vCard avatar is disabled even if disabling the PEP avatar fails. This is equivalent to :meth:`disable_avatar` for vCard-based avatars, but will also remove ...
python
def wipe_avatar(self): """ Remove all avatar data stored on the server. If :attr:`synchronize_vcard` is true, the vCard avatar is disabled even if disabling the PEP avatar fails. This is equivalent to :meth:`disable_avatar` for vCard-based avatars, but will also remove ...
Remove all avatar data stored on the server. If :attr:`synchronize_vcard` is true, the vCard avatar is disabled even if disabling the PEP avatar fails. This is equivalent to :meth:`disable_avatar` for vCard-based avatars, but will also remove the data PubSub node for PEP avatar...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/avatar/service.py#L998-L1034
horazont/aioxmpp
aioxmpp/blocking/service.py
BlockingClient.block_jids
def block_jids(self, jids_to_block): """ Add the JIDs in the sequence `jids_to_block` to the client's blocklist. """ yield from self._check_for_blocking() if not jids_to_block: return cmd = blocking_xso.BlockCommand(jids_to_block) iq = aioxmp...
python
def block_jids(self, jids_to_block): """ Add the JIDs in the sequence `jids_to_block` to the client's blocklist. """ yield from self._check_for_blocking() if not jids_to_block: return cmd = blocking_xso.BlockCommand(jids_to_block) iq = aioxmp...
Add the JIDs in the sequence `jids_to_block` to the client's blocklist.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/blocking/service.py#L134-L149
horazont/aioxmpp
aioxmpp/blocking/service.py
BlockingClient.unblock_jids
def unblock_jids(self, jids_to_unblock): """ Remove the JIDs in the sequence `jids_to_block` from the client's blocklist. """ yield from self._check_for_blocking() if not jids_to_unblock: return cmd = blocking_xso.UnblockCommand(jids_to_unblock) ...
python
def unblock_jids(self, jids_to_unblock): """ Remove the JIDs in the sequence `jids_to_block` from the client's blocklist. """ yield from self._check_for_blocking() if not jids_to_unblock: return cmd = blocking_xso.UnblockCommand(jids_to_unblock) ...
Remove the JIDs in the sequence `jids_to_block` from the client's blocklist.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/blocking/service.py#L152-L167
horazont/aioxmpp
aioxmpp/forms/form.py
DescriptorClass._register_descriptor_keys
def _register_descriptor_keys(self, descriptor, keys): """ Register the given descriptor keys for the given descriptor at the class. :param descriptor: The descriptor for which the `keys` shall be registered. :type descriptor: :class:`AbstractDescripto...
python
def _register_descriptor_keys(self, descriptor, keys): """ Register the given descriptor keys for the given descriptor at the class. :param descriptor: The descriptor for which the `keys` shall be registered. :type descriptor: :class:`AbstractDescripto...
Register the given descriptor keys for the given descriptor at the class. :param descriptor: The descriptor for which the `keys` shall be registered. :type descriptor: :class:`AbstractDescriptor` instance :param keys: An iterable of descriptor keys :ra...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/forms/form.py#L177-L227
horazont/aioxmpp
aioxmpp/forms/form.py
FormClass.from_xso
def from_xso(self, xso): """ Construct and return an instance from the given `xso`. .. note:: This is a static method (classmethod), even though sphinx does not document it as such. :param xso: A :xep:`4` data form :type xso: :class:`~.Data` :rais...
python
def from_xso(self, xso): """ Construct and return an instance from the given `xso`. .. note:: This is a static method (classmethod), even though sphinx does not document it as such. :param xso: A :xep:`4` data form :type xso: :class:`~.Data` :rais...
Construct and return an instance from the given `xso`. .. note:: This is a static method (classmethod), even though sphinx does not document it as such. :param xso: A :xep:`4` data form :type xso: :class:`~.Data` :raises ValueError: if the ``FORM_TYPE`` mismatche...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/forms/form.py#L231-L307
horazont/aioxmpp
aioxmpp/forms/form.py
Form.render_reply
def render_reply(self): """ Create a :class:`~.Data` object equal to the object from which the from was created through :meth:`from_xso`, except that the values of the fields are exchanged with the values set on the form. Fields which have no corresponding form descriptor are le...
python
def render_reply(self): """ Create a :class:`~.Data` object equal to the object from which the from was created through :meth:`from_xso`, except that the values of the fields are exchanged with the values set on the form. Fields which have no corresponding form descriptor are le...
Create a :class:`~.Data` object equal to the object from which the from was created through :meth:`from_xso`, except that the values of the fields are exchanged with the values set on the form. Fields which have no corresponding form descriptor are left untouched. Fields which are acces...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/forms/form.py#L389-L425
horazont/aioxmpp
aioxmpp/forms/form.py
Form.render_request
def render_request(self): """ Create a :class:`Data` object containing all fields known to the :class:`Form`. If the :class:`Form` has a :attr:`LAYOUT` attribute, it is used during generation. """ data = forms_xso.Data(type_=forms_xso.DataType.FORM) try: ...
python
def render_request(self): """ Create a :class:`Data` object containing all fields known to the :class:`Form`. If the :class:`Form` has a :attr:`LAYOUT` attribute, it is used during generation. """ data = forms_xso.Data(type_=forms_xso.DataType.FORM) try: ...
Create a :class:`Data` object containing all fields known to the :class:`Form`. If the :class:`Form` has a :attr:`LAYOUT` attribute, it is used during generation.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/forms/form.py#L427-L460
horazont/aioxmpp
aioxmpp/entitycaps/service.py
Cache.lookup
def lookup(self, key): """ Look up the given `node` URL using the given `hash_` first in the database and then by waiting on the futures created with :meth:`create_query_future` for that node URL and hash. If the hash is not in the database, :meth:`lookup` iterates as long as ...
python
def lookup(self, key): """ Look up the given `node` URL using the given `hash_` first in the database and then by waiting on the futures created with :meth:`create_query_future` for that node URL and hash. If the hash is not in the database, :meth:`lookup` iterates as long as ...
Look up the given `node` URL using the given `hash_` first in the database and then by waiting on the futures created with :meth:`create_query_future` for that node URL and hash. If the hash is not in the database, :meth:`lookup` iterates as long as there are pending futures for the giv...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/entitycaps/service.py#L134-L160
horazont/aioxmpp
aioxmpp/entitycaps/service.py
Cache.create_query_future
def create_query_future(self, key): """ Create and return a :class:`asyncio.Future` for the given `hash_` function and `node` URL. The future is referenced internally and used by any calls to :meth:`lookup` which are made while the future is pending. The future is removed from th...
python
def create_query_future(self, key): """ Create and return a :class:`asyncio.Future` for the given `hash_` function and `node` URL. The future is referenced internally and used by any calls to :meth:`lookup` which are made while the future is pending. The future is removed from th...
Create and return a :class:`asyncio.Future` for the given `hash_` function and `node` URL. The future is referenced internally and used by any calls to :meth:`lookup` which are made while the future is pending. The future is removed from the internal storage automatically when a result o...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/entitycaps/service.py#L162-L177
horazont/aioxmpp
aioxmpp/entitycaps/service.py
Cache.add_cache_entry
def add_cache_entry(self, key, entry): """ Add the given `entry` (which must be a :class:`~.disco.xso.InfoQuery` instance) to the user-level database keyed with the hash function type `hash_` and the `node` URL. The `entry` is **not** validated to actually map to `node` with the ...
python
def add_cache_entry(self, key, entry): """ Add the given `entry` (which must be a :class:`~.disco.xso.InfoQuery` instance) to the user-level database keyed with the hash function type `hash_` and the `node` URL. The `entry` is **not** validated to actually map to `node` with the ...
Add the given `entry` (which must be a :class:`~.disco.xso.InfoQuery` instance) to the user-level database keyed with the hash function type `hash_` and the `node` URL. The `entry` is **not** validated to actually map to `node` with the given `hash_` function, it is expected that the cal...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/entitycaps/service.py#L179-L194
horazont/aioxmpp
aioxmpp/pep/service.py
PEPClient.claim_pep_node
def claim_pep_node(self, node_namespace, *, register_feature=True, notify=False): """ Claim node `node_namespace`. :param node_namespace: the pubsub node whose events shall be handled. :param register_feature: Whether to publish the `node_namespace` ...
python
def claim_pep_node(self, node_namespace, *, register_feature=True, notify=False): """ Claim node `node_namespace`. :param node_namespace: the pubsub node whose events shall be handled. :param register_feature: Whether to publish the `node_namespace` ...
Claim node `node_namespace`. :param node_namespace: the pubsub node whose events shall be handled. :param register_feature: Whether to publish the `node_namespace` as feature. :param notify: Whether to register the ``+notify`` feature to receive notification ...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pep/service.py#L90-L146
horazont/aioxmpp
aioxmpp/pep/service.py
PEPClient.available
def available(self): """ Check whether we have a PEP identity associated with our account. """ disco_info = yield from self._disco_client.query_info( self.client.local_jid.bare() ) for item in disco_info.identities.filter(attrs={"category": "pubsub"}): ...
python
def available(self): """ Check whether we have a PEP identity associated with our account. """ disco_info = yield from self._disco_client.query_info( self.client.local_jid.bare() ) for item in disco_info.identities.filter(attrs={"category": "pubsub"}): ...
Check whether we have a PEP identity associated with our account.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pep/service.py#L152-L163
horazont/aioxmpp
aioxmpp/pep/service.py
PEPClient.publish
def publish(self, node, data, *, id_=None, access_model=None): """ Publish an item `data` in the PubSub node `node` on the PEP service associated with the user's JID. :param node: The PubSub node to publish to. :param data: The item to publish. :type data: An XSO represe...
python
def publish(self, node, data, *, id_=None, access_model=None): """ Publish an item `data` in the PubSub node `node` on the PEP service associated with the user's JID. :param node: The PubSub node to publish to. :param data: The item to publish. :type data: An XSO represe...
Publish an item `data` in the PubSub node `node` on the PEP service associated with the user's JID. :param node: The PubSub node to publish to. :param data: The item to publish. :type data: An XSO representing the paylaod. :param id_: The id the published item shall have. ...
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pep/service.py#L193-L249
horazont/aioxmpp
aioxmpp/pep/service.py
RegisteredPEPNode.close
def close(self): """ Unclaim the PEP node and unregister the registered features. It is not necessary to call close if this claim is managed by :class:`~aioxmpp.pep.register_pep_node`. """ if self._closed: return self._closed = True self._pep...
python
def close(self): """ Unclaim the PEP node and unregister the registered features. It is not necessary to call close if this claim is managed by :class:`~aioxmpp.pep.register_pep_node`. """ if self._closed: return self._closed = True self._pep...
Unclaim the PEP node and unregister the registered features. It is not necessary to call close if this claim is managed by :class:`~aioxmpp.pep.register_pep_node`.
https://github.com/horazont/aioxmpp/blob/22a68e5e1d23f2a4dee470092adbd4672f9ef061/aioxmpp/pep/service.py#L326-L338
neo4j-contrib/django-neomodel
django_neomodel/__init__.py
DjangoNode.full_clean
def full_clean(self, exclude, validate_unique=False): """ Validate node, on error raising ValidationErrors which can be handled by django forms :param exclude: :param validate_unique: Check if conflicting node exists in the labels indexes :return: """ # validate...
python
def full_clean(self, exclude, validate_unique=False): """ Validate node, on error raising ValidationErrors which can be handled by django forms :param exclude: :param validate_unique: Check if conflicting node exists in the labels indexes :return: """ # validate...
Validate node, on error raising ValidationErrors which can be handled by django forms :param exclude: :param validate_unique: Check if conflicting node exists in the labels indexes :return:
https://github.com/neo4j-contrib/django-neomodel/blob/9bee6708c0df8e4d1b546fe57e1f735e63a29d81/django_neomodel/__init__.py#L148-L163
mishbahr/django-users2
users/models.py
AbstractUser.email_user
def email_user(self, subject, message, from_email=None): """ Send an email to this User.""" send_mail(subject, message, from_email, [self.email])
python
def email_user(self, subject, message, from_email=None): """ Send an email to this User.""" send_mail(subject, message, from_email, [self.email])
Send an email to this User.
https://github.com/mishbahr/django-users2/blob/1ee244dc4ca162b2331d2a44d45848fdcb80f329/users/models.py#L47-L49
mishbahr/django-users2
users/admin.py
UserAdmin.activate_users
def activate_users(self, request, queryset): """ Activates the selected users, if they are not already activated. """ n = 0 for user in queryset: if not user.is_active: user.activate() n += 1 self.message_user( ...
python
def activate_users(self, request, queryset): """ Activates the selected users, if they are not already activated. """ n = 0 for user in queryset: if not user.is_active: user.activate() n += 1 self.message_user( ...
Activates the selected users, if they are not already activated.
https://github.com/mishbahr/django-users2/blob/1ee244dc4ca162b2331d2a44d45848fdcb80f329/users/admin.py#L79-L93
mishbahr/django-users2
users/admin.py
UserAdmin.send_activation_email
def send_activation_email(self, request, queryset): """ Send activation emails for the selected users, if they are not already activated. """ n = 0 for user in queryset: if not user.is_active and settings.USERS_VERIFY_EMAIL: send_activation_ema...
python
def send_activation_email(self, request, queryset): """ Send activation emails for the selected users, if they are not already activated. """ n = 0 for user in queryset: if not user.is_active and settings.USERS_VERIFY_EMAIL: send_activation_ema...
Send activation emails for the selected users, if they are not already activated.
https://github.com/mishbahr/django-users2/blob/1ee244dc4ca162b2331d2a44d45848fdcb80f329/users/admin.py#L96-L109
mishbahr/django-users2
users/managers.py
UserManager.get_queryset
def get_queryset(self): """ Fixes get_query_set vs get_queryset for Django <1.6 """ try: qs = super(UserManager, self).get_queryset() except AttributeError: # pragma: no cover qs = super(UserManager, self).get_query_set() return qs
python
def get_queryset(self): """ Fixes get_query_set vs get_queryset for Django <1.6 """ try: qs = super(UserManager, self).get_queryset() except AttributeError: # pragma: no cover qs = super(UserManager, self).get_query_set() return qs
Fixes get_query_set vs get_queryset for Django <1.6
https://github.com/mishbahr/django-users2/blob/1ee244dc4ca162b2331d2a44d45848fdcb80f329/users/managers.py#L11-L19
eandersson/amqpstorm
amqpstorm/io.py
Poller.is_ready
def is_ready(self): """Is Socket Ready. :rtype: tuple """ try: ready, _, _ = self.select.select([self.fileno], [], [], POLL_TIMEOUT) return bool(ready) except self.select.error as why: if why.args[0...
python
def is_ready(self): """Is Socket Ready. :rtype: tuple """ try: ready, _, _ = self.select.select([self.fileno], [], [], POLL_TIMEOUT) return bool(ready) except self.select.error as why: if why.args[0...
Is Socket Ready. :rtype: tuple
https://github.com/eandersson/amqpstorm/blob/38330906c0af19eea482f43c5ce79bab98a1e064/amqpstorm/io.py#L39-L51
eandersson/amqpstorm
amqpstorm/io.py
IO.close
def close(self): """Close Socket. :return: """ self._wr_lock.acquire() self._rd_lock.acquire() try: self._running.clear() if self.socket: self._close_socket() if self._inbound_thread: self._inbound_threa...
python
def close(self): """Close Socket. :return: """ self._wr_lock.acquire() self._rd_lock.acquire() try: self._running.clear() if self.socket: self._close_socket() if self._inbound_thread: self._inbound_threa...
Close Socket. :return:
https://github.com/eandersson/amqpstorm/blob/38330906c0af19eea482f43c5ce79bab98a1e064/amqpstorm/io.py#L70-L88
eandersson/amqpstorm
amqpstorm/io.py
IO.open
def open(self): """Open Socket and establish a connection. :raises AMQPConnectionError: Raises if the connection encountered an error. :return: """ self._wr_lock.acquire() self._rd_lock.acquire() try: self.data_in ...
python
def open(self): """Open Socket and establish a connection. :raises AMQPConnectionError: Raises if the connection encountered an error. :return: """ self._wr_lock.acquire() self._rd_lock.acquire() try: self.data_in ...
Open Socket and establish a connection. :raises AMQPConnectionError: Raises if the connection encountered an error. :return:
https://github.com/eandersson/amqpstorm/blob/38330906c0af19eea482f43c5ce79bab98a1e064/amqpstorm/io.py#L90-L109
eandersson/amqpstorm
amqpstorm/io.py
IO.write_to_socket
def write_to_socket(self, frame_data): """Write data to the socket. :param str frame_data: :return: """ self._wr_lock.acquire() try: total_bytes_written = 0 bytes_to_send = len(frame_data) while total_bytes_written < bytes_to_send: ...
python
def write_to_socket(self, frame_data): """Write data to the socket. :param str frame_data: :return: """ self._wr_lock.acquire() try: total_bytes_written = 0 bytes_to_send = len(frame_data) while total_bytes_written < bytes_to_send: ...
Write data to the socket. :param str frame_data: :return:
https://github.com/eandersson/amqpstorm/blob/38330906c0af19eea482f43c5ce79bab98a1e064/amqpstorm/io.py#L111-L139
eandersson/amqpstorm
amqpstorm/io.py
IO._close_socket
def _close_socket(self): """Shutdown and close the Socket. :return: """ try: self.socket.shutdown(socket.SHUT_RDWR) except (OSError, socket.error): pass self.socket.close()
python
def _close_socket(self): """Shutdown and close the Socket. :return: """ try: self.socket.shutdown(socket.SHUT_RDWR) except (OSError, socket.error): pass self.socket.close()
Shutdown and close the Socket. :return:
https://github.com/eandersson/amqpstorm/blob/38330906c0af19eea482f43c5ce79bab98a1e064/amqpstorm/io.py#L141-L150