Debian Codegraph @

python/proton/__init__.py

raw
1 #
2 # Licensed to the Apache Software Foundation (ASF) under one
3 # or more contributor license agreements. See the NOTICE file
4 # distributed with this work for additional information
5 # regarding copyright ownership. The ASF licenses this file
6 # to you under the Apache License, Version 2.0 (the
7 # "License"); you may not use this file except in compliance
8 # with the License. You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing,
13 # software distributed under the License is distributed on an
14 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 # KIND, either express or implied. See the License for the
16 # specific language governing permissions and limitations
17 # under the License.
18 #
19
20 """
21 The proton module defines a suite of APIs that implement the AMQP 1.0
22 protocol.
23
24 The proton APIs consist of the following classes:
25
26 - :class:`Message` -- A class for creating and/or accessing AMQP message content.
27 - :class:`Data` -- A class for creating and/or accessing arbitrary AMQP encoded data.
28 """
29 from __future__ import absolute_import
30
31 import logging
32 import logging.config
33 import os
34
35 from cproton import PN_VERSION_MAJOR, PN_VERSION_MINOR, PN_VERSION_POINT
36
37 from ._condition import Condition
38 from ._data import UNDESCRIBED, Array, Data, Described, char, symbol, timestamp, ubyte, ushort, uint, ulong, \
39 byte, short, int32, float32, decimal32, decimal64, decimal128, AnnotationDict, PropertyDict, SymbolList
40 from ._delivery import Delivery, Disposition
41 from ._endpoints import Endpoint, Connection, Session, Link, Receiver, Sender, Terminus
42 from ._events import Collector, Event, EventType, Handler
43 from ._exceptions import ProtonException, MessageException, DataException, TransportException, \
44 SSLException, SSLUnavailable, ConnectionException, SessionException, LinkException, Timeout, Interrupt
45 from ._message import Message
46 from ._transport import Transport, SASL, SSL, SSLDomain, SSLSessionDetails
47 from ._url import Url
48
49 __all__ = [
50 "API_LANGUAGE",
51 "IMPLEMENTATION_LANGUAGE",
52 "UNDESCRIBED",
53 "AnnotationDict",
54 "Array",
55 "Collector",
56 "Condition",
57 "Connection",
58 "ConnectionException",
59 "Data",
60 "DataException",
61 "Delivery",
62 "Disposition",
63 "Described",
64 "Endpoint",
65 "Event",
66 "EventType",
67 "Handler",
68 "Link",
69 "LinkException",
70 "Message",
71 "MessageException",
72 "PropertyDict",
73 "ProtonException",
74 "VERSION_MAJOR",
75 "VERSION_MINOR",
76 "Receiver",
77 "SASL",
78 "Sender",
79 "Session",
80 "SessionException",
81 "SSL",
82 "SSLDomain",
83 "SSLSessionDetails",
84 "SSLUnavailable",
85 "SSLException",
86 "SymbolList",
87 "Terminus",
88 "Timeout",
89 "Interrupt",
90 "Transport",
91 "TransportException",
92 "Url",
93 "char",
94 "symbol",
95 "timestamp",
96 "ulong",
97 "byte",
98 "short",
99 "int32",
100 "ubyte",
101 "ushort",
102 "uint",
103 "float32",
104 "decimal32",
105 "decimal64",
106 "decimal128"
107 ]
108
109 VERSION_MAJOR = PN_VERSION_MAJOR
110 VERSION_MINOR = PN_VERSION_MINOR
111 VERSION_POINT = PN_VERSION_POINT
112 VERSION = (VERSION_MAJOR, VERSION_MINOR, VERSION_POINT)
113 API_LANGUAGE = "C"
114 IMPLEMENTATION_LANGUAGE = "C"
115
116
117 handler = logging.NullHandler()
118
119 logconfigfile = os.getenv('PNPY_LOGGER_CONFIG', None)
120 if logconfigfile:
121 logging.config.fileConfig(logconfigfile, None, False)
122 else:
123 log = logging.getLogger("proton")
124 log.addHandler(handler)