Package dbus
[hide private]
[frames] | no frames]

Source Code for Package dbus

  1  """\ 
  2  Implements the public API for a D-Bus client. See the dbus.service module 
  3  to export objects or claim well-known names. 
  4   
  5  .. 
  6    for epydoc's benefit 
  7   
  8  :NewField SupportedUsage: Supported usage 
  9  :NewField Constructor: Constructor 
 10  """ 
 11   
 12  # Copyright (C) 2003, 2004, 2005, 2006 Red Hat Inc. <http://www.redhat.com/> 
 13  # Copyright (C) 2003 David Zeuthen 
 14  # Copyright (C) 2004 Rob Taylor 
 15  # Copyright (C) 2005, 2006 Collabora Ltd. <http://www.collabora.co.uk/> 
 16  # 
 17  # Permission is hereby granted, free of charge, to any person 
 18  # obtaining a copy of this software and associated documentation 
 19  # files (the "Software"), to deal in the Software without 
 20  # restriction, including without limitation the rights to use, copy, 
 21  # modify, merge, publish, distribute, sublicense, and/or sell copies 
 22  # of the Software, and to permit persons to whom the Software is 
 23  # furnished to do so, subject to the following conditions: 
 24  # 
 25  # The above copyright notice and this permission notice shall be 
 26  # included in all copies or substantial portions of the Software. 
 27  # 
 28  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
 29  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
 30  # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
 31  # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
 32  # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
 33  # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
 34  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
 35  # DEALINGS IN THE SOFTWARE. 
 36   
 37  import os 
 38   
 39  __all__ = ( 
 40             # from _dbus 
 41             'Bus', 'SystemBus', 'SessionBus', 'StarterBus', 
 42   
 43             # from proxies 
 44             'Interface', 
 45   
 46             # from _dbus_bindings 
 47             'get_default_main_loop', 'set_default_main_loop', 
 48   
 49             'validate_interface_name', 'validate_member_name', 
 50             'validate_bus_name', 'validate_object_path', 
 51             'validate_error_name', 
 52   
 53             'BUS_DAEMON_NAME', 'BUS_DAEMON_PATH', 'BUS_DAEMON_IFACE', 
 54             'LOCAL_PATH', 'LOCAL_IFACE', 'PEER_IFACE', 
 55             'INTROSPECTABLE_IFACE', 'PROPERTIES_IFACE', 
 56   
 57             'ObjectPath', 'ByteArray', 'Signature', 'Byte', 'Boolean', 
 58             'Int16', 'UInt16', 'Int32', 'UInt32', 'Int64', 'UInt64', 
 59             'Double', 'String', 'Array', 'Struct', 'Dictionary', 'UTF8String', 
 60   
 61             # from exceptions 
 62             'DBusException', 
 63             'MissingErrorHandlerException', 'MissingReplyHandlerException', 
 64             'ValidationException', 'IntrospectionParserException', 
 65             'UnknownMethodException', 'NameExistsException', 
 66   
 67             # submodules 
 68             'service', 'mainloop', 'lowlevel' 
 69             ) 
 70  __docformat__ = 'restructuredtext' 
 71   
 72  try: 
 73      from dbus._version import version, __version__ 
 74  except ImportError: 
 75      pass 
 76   
 77  # OLPC Sugar compatibility 
 78  import dbus.exceptions as exceptions 
 79  import dbus.types as types 
 80   
 81  from _dbus_bindings import get_default_main_loop, set_default_main_loop,\ 
 82                             validate_interface_name, validate_member_name,\ 
 83                             validate_bus_name, validate_object_path,\ 
 84                             validate_error_name 
 85  from _dbus_bindings import BUS_DAEMON_NAME, BUS_DAEMON_PATH, BUS_DAEMON_IFACE,\ 
 86                             LOCAL_PATH, LOCAL_IFACE, PEER_IFACE,\ 
 87                             INTROSPECTABLE_IFACE, PROPERTIES_IFACE 
 88   
 89  from dbus.exceptions import MissingErrorHandlerException, \ 
 90                              MissingReplyHandlerException, \ 
 91                              ValidationException, \ 
 92                              IntrospectionParserException, \ 
 93                              UnknownMethodException, \ 
 94                              NameExistsException, \ 
 95                              DBusException 
 96  from _dbus_bindings import ObjectPath, ByteArray, Signature, Byte, Boolean,\ 
 97                             Int16, UInt16, Int32, UInt32, Int64, UInt64,\ 
 98                             Double, String, Array, Struct, Dictionary, \ 
 99                             UTF8String 
100  from dbus._dbus import Bus, SystemBus, SessionBus, StarterBus 
101  from dbus.proxies import Interface 
102   
103   
104  if 'DBUS_PYTHON_NO_DEPRECATED' not in os.environ: 
105      from dbus._dbus import dbus_bindings    # for backwards compat 
106