Package proton
[frames] | no frames]

Source Code for Package proton

  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   - L{Message}   -- A class for creating and/or accessing AMQP message content. 
 27   - L{Data}      -- A class for creating and/or accessing arbitrary AMQP encoded 
 28                    data. 
 29   
 30  """ 
 31  from __future__ import absolute_import 
 32   
 33  import logging 
 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 
 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, ABORTED, ACCEPTED, PENDING, REJECTED, RELEASED, MODIFIED, SETTLED 
 46  from ._transport import Transport, SASL, SSL, SSLDomain, SSLSessionDetails 
 47  from ._url import Url 
 48   
 49  __all__ = [ 
 50      "API_LANGUAGE", 
 51      "IMPLEMENTATION_LANGUAGE", 
 52      "ABORTED", 
 53      "ACCEPTED", 
 54      "PENDING", 
 55      "REJECTED", 
 56      "RELEASED", 
 57      "MODIFIED", 
 58      "SETTLED", 
 59      "UNDESCRIBED", 
 60      "Array", 
 61      "Collector", 
 62      "Condition", 
 63      "Connection", 
 64      "Data", 
 65      "DataException", 
 66      "Delivery", 
 67      "Disposition", 
 68      "Described", 
 69      "Endpoint", 
 70      "Event", 
 71      "EventType", 
 72      "Handler", 
 73      "Link", 
 74      "LinkException", 
 75      "Message", 
 76      "MessageException", 
 77      "ProtonException", 
 78      "VERSION_MAJOR", 
 79      "VERSION_MINOR", 
 80      "Receiver", 
 81      "SASL", 
 82      "Sender", 
 83      "Session", 
 84      "SessionException", 
 85      "SSL", 
 86      "SSLDomain", 
 87      "SSLSessionDetails", 
 88      "SSLUnavailable", 
 89      "SSLException", 
 90      "Terminus", 
 91      "Timeout", 
 92      "Interrupt", 
 93      "Transport", 
 94      "TransportException", 
 95      "Url", 
 96      "char", 
 97      "symbol", 
 98      "timestamp", 
 99      "ulong", 
100      "byte", 
101      "short", 
102      "int32", 
103      "ubyte", 
104      "ushort", 
105      "uint", 
106      "float32", 
107      "decimal32", 
108      "decimal64", 
109      "decimal128" 
110  ] 
111   
112  VERSION_MAJOR = PN_VERSION_MAJOR 
113  VERSION_MINOR = PN_VERSION_MINOR 
114  VERSION_POINT = PN_VERSION_POINT 
115  VERSION = (VERSION_MAJOR, VERSION_MINOR, VERSION_POINT) 
116  API_LANGUAGE = "C" 
117  IMPLEMENTATION_LANGUAGE = "C" 
118   
119   
120  # This private NullHandler is required for Python 2.6, 
121  # when we no longer support 2.6 replace this NullHandler class definition and assignment with: 
122  #  handler = logging.NullHandler() 
123 -class NullHandler(logging.Handler):
124 - def handle(self, record):
125 pass
126
127 - def emit(self, record):
128 pass
129
130 - def createLock(self):
131 self.lock = None
132 133 134 handler = NullHandler() 135 136 log = logging.getLogger("proton") 137 log.addHandler(handler) 138 139
140 -def generate_uuid():
141 import uuid 142 return uuid.uuid4()
143