File: __init__.py

package info (click to toggle)
python-aioxmpp 0.12.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 6,152 kB
  • sloc: python: 96,969; xml: 215; makefile: 155; sh: 72
file content (154 lines) | stat: -rw-r--r-- 4,531 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
########################################################################
# File name: __init__.py
# This file is part of: aioxmpp
#
# LICENSE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program.  If not, see
# <http://www.gnu.org/licenses/>.
#
########################################################################
"""
Version information
###################

There are two ways to obtain the imported version of the :mod:`aioxmpp`
package:

.. autodata:: __version__

.. data:: version

   Alias of :data:`__version__`.

.. autodata:: version_info

.. _api-aioxmpp-services:

Overview of Services
####################

.. autosummary::
    :nosignatures:

    aioxmpp.AdHocClient
    aioxmpp.AvatarService
    aioxmpp.BlockingClient
    aioxmpp.BookmarkClient
    aioxmpp.CarbonsClient
    aioxmpp.DiscoClient
    aioxmpp.DiscoServer
    aioxmpp.EntityCapsService
    aioxmpp.MUCClient
    aioxmpp.PingService
    aioxmpp.PresenceClient
    aioxmpp.PresenceServer
    aioxmpp.PEPClient
    aioxmpp.RosterClient
    aioxmpp.VersionServer

Shorthands
##########

.. function:: make_security_layer

   Alias of :func:`aioxmpp.security_layer.make`.

"""
from ._version import version_info, __version__, version  # NOQA: F401

#: The imported :mod:`aioxmpp` version as a tuple.
#:
#: The components of the tuple are, in order: `major version`, `minor version`,
#: `patch level`, and `pre-release identifier`.
#:
#: .. seealso::
#:
#:    :ref:`api-stability`
version_info = version_info

#: The imported :mod:`aioxmpp` version as a string.
#:
#: The version number is dot-separated; in pre-release or development versions,
#: the version number is followed by a hypen-separated pre-release identifier.
#:
#: .. seealso::
#:
#:    :ref:`api-stability`
__version__ = __version__

# XXX: ^ this is a hack to make Sphinx find the docs. We could also be using
# .. data instead of .. autodata, but that has the downside that the actual
# version number isn’t printed in the docs (without additional maintenance
# cost).

import asyncio  # NOQA
# Adds fallback if asyncio version does not provide an ensure_future function.
if not hasattr(asyncio, "ensure_future"):
    asyncio.ensure_future = getattr(asyncio, "async")

from .errors import (  # NOQA
    XMPPAuthError,
    XMPPCancelError,
    XMPPContinueError,
    XMPPModifyError,
    XMPPWaitError,
    ErrorCondition,
)
from .stanza import Presence, IQ, Message  # NOQA: F401
from .structs import (  # NOQA: F401
    JID,
    PresenceShow,
    PresenceState,
    MessageType,
    PresenceType,
    IQType,
    ErrorType,
    jid_escape,
    jid_unescape,
)
from .security_layer import make as make_security_layer  # NOQA: F401
from .node import Client, PresenceManagedClient  # NOQA: F401

# services
from .presence import PresenceClient, PresenceServer  # NOQA: F401
from .roster import RosterClient  # NOQA: F401
from .disco import DiscoServer, DiscoClient  # NOQA: F401
from .entitycaps import EntityCapsService  # NOQA: F401
from .muc import MUCClient  # NOQA: F401
from .pubsub import PubSubClient  # NOQA: F401
from .shim import SHIMService  # NOQA: F401
from .adhoc import AdHocClient, AdHocServer  # NOQA: F401
from .avatar import AvatarService  # NOQA: F401
from .blocking import BlockingClient  # NOQA: F401
from .carbons import CarbonsClient  # NOQA: F401
from .ping import PingService  # NOQA: F401
from .pep import PEPClient  # NOQA: F401
from .bookmarks import BookmarkClient  # NOQA: F401
from .version import VersionServer  # NOQA: F401
from .mdr import DeliveryReceiptsService  # NOQA: F401

from . import httpupload  # NOQA: F401


def set_strict_mode():
    from .stanza import Error
    from .stream import StanzaStream
    from . import structs
    Message.type_.type_.allow_coerce = False
    IQ.type_.type_.allow_coerce = False
    Error.type_.type_.allow_coerce = False
    Presence.type_.type_.allow_coerce = False
    StanzaStream._ALLOW_ENUM_COERCION = False
    structs._USE_COMPAT_ENUM = False