Implement DBusException in pure Python; add get_dbus_name() method and name= keyword...
[dbus-python-phuang.git] / dbus / dbus_bindings.py
bloba45ca9f4b7e6ddf52a5612832510023686948478
1 # Backwards-compatibility with the old dbus_bindings.
3 from warnings import warn as _warn
5 _dbus_bindings_warning = DeprecationWarning("""\
6 The dbus_bindings module is not public API and will go away soon.
8 Most uses of dbus_bindings are applications catching the exception
9 dbus.dbus_bindings.DBusException. You should use dbus.DBusException
10 instead (this is compatible with all dbus-python versions since 0.40.2).
12 If you need additional public API, please contact the maintainers via
13 <dbus@lists.freedesktop.org>.
14 """)
16 _warn(_dbus_bindings_warning, DeprecationWarning, stacklevel=2)
18 # Exceptions
19 from dbus.exceptions import DBusException
20 class ConnectionError(Exception): pass
22 # Types
23 from dbus.types import *
25 # Messages
26 from _dbus_bindings import Message, SignalMessage as Signal,\
27 MethodCallMessage as MethodCall,\
28 MethodReturnMessage as MethodReturn,\
29 ErrorMessage as Error
30 # MessageIter has gone away, thankfully
32 # Connection
33 from _dbus_bindings import Connection
35 from dbus import Bus
36 bus_request_name = Bus.request_name
37 bus_release_name = Bus.release_name