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  __all__ = [ 
 38             # from _dbus 
 39             'Bus', 'SystemBus', 'SessionBus', 'StarterBus', 
 40   
 41             # from proxies 
 42             'Interface', 
 43   
 44             # from _dbus_bindings 
 45             'get_default_main_loop', 'set_default_main_loop', 
 46   
 47             'validate_interface_name', 'validate_member_name', 
 48             'validate_bus_name', 'validate_object_path', 
 49             'validate_error_name', 
 50   
 51             'BUS_DAEMON_NAME', 'BUS_DAEMON_PATH', 'BUS_DAEMON_IFACE', 
 52             'LOCAL_PATH', 'LOCAL_IFACE', 'PEER_IFACE', 
 53             'INTROSPECTABLE_IFACE', 'PROPERTIES_IFACE', 
 54   
 55             'ObjectPath', 'ByteArray', 'Signature', 'Byte', 'Boolean', 
 56             'Int16', 'UInt16', 'Int32', 'UInt32', 'Int64', 'UInt64', 
 57             'Double', 'String', 'Array', 'Struct', 'Dictionary', 
 58   
 59             # from exceptions 
 60             'DBusException', 
 61             'MissingErrorHandlerException', 'MissingReplyHandlerException', 
 62             'ValidationException', 'IntrospectionParserException', 
 63             'UnknownMethodException', 'NameExistsException', 
 64   
 65             # submodules 
 66             'service', 'mainloop', 'lowlevel' 
 67             ] 
 68   
 69  from dbus._compat import is_py2 
 70  if is_py2: 
 71      __all__.append('UTF8String') 
 72   
 73  __docformat__ = 'restructuredtext' 
 74   
 75  # OLPC Sugar compatibility 
 76  import dbus.exceptions as exceptions 
 77  import dbus.types as types 
 78   
 79  from _dbus_bindings import __version__ 
 80  version = tuple(map(int, __version__.split('.'))) 
 81   
 82  from _dbus_bindings import ( 
 83      get_default_main_loop, set_default_main_loop, validate_bus_name, 
 84      validate_error_name, validate_interface_name, validate_member_name, 
 85      validate_object_path) 
 86  from _dbus_bindings import ( 
 87      BUS_DAEMON_IFACE, BUS_DAEMON_NAME, BUS_DAEMON_PATH, INTROSPECTABLE_IFACE, 
 88      LOCAL_IFACE, LOCAL_PATH, PEER_IFACE, PROPERTIES_IFACE) 
 89   
 90  from dbus.exceptions import ( 
 91      DBusException, IntrospectionParserException, MissingErrorHandlerException, 
 92      MissingReplyHandlerException, NameExistsException, UnknownMethodException, 
 93      ValidationException) 
 94  from _dbus_bindings import ( 
 95      Array, Boolean, Byte, ByteArray, Dictionary, Double, Int16, Int32, Int64, 
 96      ObjectPath, Signature, String, Struct, UInt16, UInt32, UInt64) 
 97   
 98  if is_py2: 
 99      from _dbus_bindings import UTF8String 
100   
101  from dbus._dbus import Bus, SystemBus, SessionBus, StarterBus 
102  from dbus.proxies import Interface 
103