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

Package dbus

source code

Implements the public API for a D-Bus client. See the dbus.service module to export objects or claim well-known names.


Version: 1.1.1

Submodules [hide private]

Classes [hide private]
  Array
An array of similar items, implemented as a subtype of list.
  Boolean
A boolean, represented as a subtype of int (not bool, because bool cannot be subclassed).
  Bus
A connection to one of three possible standard buses, the SESSION, SYSTEM, or STARTER bus. This class manages shared connections to those buses.
  Byte
An unsigned byte: a subtype of int, with range restricted to [0, 255].
  ByteArray
ByteArray is a subtype of str which can be used when you want an efficient immutable representation of a D-Bus byte array (signature 'ay').
  DBusException
  Dictionary
An mapping whose keys are similar and whose values are similar, implemented as a subtype of dict.
  Double
A double-precision floating point number (a subtype of float).
  Int16
A signed 16-bit integer between -0x8000 and +0x7FFF, represented as a subtype of int.
  Int32
A signed 32-bit integer between -0x8000 0000 and +0x7FFF FFFF, represented as a subtype of int.
  Int64
A signed 64-bit integer between -0x8000 0000 0000 0000 and +0x7FFF FFFF FFFF FFFF, represented as a subtype of long.
  Interface
An interface into a remote object.
  IntrospectionParserException
  MissingErrorHandlerException
  MissingReplyHandlerException
  NameExistsException
  ObjectPath
A D-Bus object path, such as '/com/example/MyApp/Documents/abc'.
  SessionBus
The session (current login) message bus.
  Signature
A string subclass whose values are restricted to valid D-Bus signatures. When iterated over, instead of individual characters it produces Signature instances representing single complete types.
  StarterBus
The bus that activated this process (only valid if this process was launched by DBus activation).
  String
A string represented using Unicode - a subtype of unicode.
  Struct
An structure containing items of possibly distinct types.
  SystemBus
The system-wide message bus.
  UInt16
An unsigned 16-bit integer between 0 and 0xFFFF, represented as a subtype of int.
  UInt32
An unsigned 32-bit integer between 0 and 0xFFFF FFFF, represented as a subtype of long.
  UInt64
An unsigned 64-bit integer between 0 and 0xFFFF FFFF FFFF FFFF, represented as a subtype of long.
  UTF8String
A string represented using UTF-8 - a subtype of str.
  UnknownMethodException
  ValidationException
Functions [hide private]
object
get_default_main_loop()
Return the global default dbus-python main loop wrapper, which is used when no main loop wrapper is passed to the Connection constructor.
 
set_default_main_loop(object)
Change the global default dbus-python main loop wrapper, which is used when no main loop wrapper is passed to the Connection constructor.
 
validate_bus_name(name, allow_unique=True, allow_well_known=True)
Raise ValueError if the argument is not a valid bus name.
 
validate_error_name(name)
Raise ValueError if the given string is not a valid error name.
 
validate_interface_name(name)
Raise ValueError if the given string is not a valid interface name.
 
validate_member_name(name)
Raise ValueError if the argument is not a valid member (signal or method) name.
 
validate_object_path(name)
Raise ValueError if the given string is not a valid object path.
Variables [hide private]
  BUS_DAEMON_IFACE = 'org.freedesktop.DBus'
  BUS_DAEMON_NAME = 'org.freedesktop.DBus'
  BUS_DAEMON_PATH = '/org/freedesktop/DBus'
  INTROSPECTABLE_IFACE = 'org.freedesktop.DBus.Introspectable'
  LOCAL_IFACE = 'org.freedesktop.DBus.Local'
  LOCAL_PATH = '/org/freedesktop/DBus/Local'
  PEER_IFACE = 'org.freedesktop.DBus.Peer'
  PROPERTIES_IFACE = 'org.freedesktop.DBus.Properties'
  __package__ = 'dbus'
Function Details [hide private]

get_default_main_loop()

 

Return the global default dbus-python main loop wrapper, which is used when no main loop wrapper is passed to the Connection constructor.

If None, there is no default and you should always pass the mainloop parameter to the constructor - if you don't, then asynchronous calls, connecting to signals and exporting objects will raise an exception. There is no default until set_default_main_loop is called.

Returns: object

set_default_main_loop(object)

 

Change the global default dbus-python main loop wrapper, which is used when no main loop wrapper is passed to the Connection constructor.

If None, return to the initial situation: there is no default, and you must always pass the mainloop parameter to the constructor.

Two types of main loop wrapper are planned in dbus-python. Native main-loop wrappers are instances of dbus.mainloop.NativeMainLoop supplied by extension modules like dbus.mainloop.glib: they have no Python API, but connect themselves to libdbus using native code. Python main-loop wrappers are not yet implemented. They will be objects supporting the interface defined by dbus.mainloop.MainLoop, with an API entirely based on Python methods.

validate_bus_name(name, allow_unique=True, allow_well_known=True)

 

Raise ValueError if the argument is not a valid bus name.

By default both unique and well-known names are accepted.

Parameters:
  • name (str) - The name to be validated
  • allow_unique (bool) - If False, unique names of the form :1.123 will be rejected
  • allow_well_known (bool) - If False, well-known names of the form com.example.Foo will be rejected

Since: 0.80

validate_error_name(name)

 
Raise ValueError if the given string is not a valid error name.

Since: 0.80

validate_interface_name(name)

 
Raise ValueError if the given string is not a valid interface name.

Since: 0.80

validate_member_name(name)

 
Raise ValueError if the argument is not a valid member (signal or method) name.

Since: 0.80

validate_object_path(name)

 
Raise ValueError if the given string is not a valid object path.

Since: 0.80