Blame dbus/glib.py

Packit 130fc8
# Copyright (C) 2004 Anders Carlsson
Packit 130fc8
# Copyright (C) 2004, 2005, 2006 Red Hat Inc. <http://www.redhat.com/>
Packit 130fc8
# Copyright (C) 2005, 2006 Collabora Ltd. <http://www.collabora.co.uk/>
Packit 130fc8
#
Packit 130fc8
# Permission is hereby granted, free of charge, to any person
Packit 130fc8
# obtaining a copy of this software and associated documentation
Packit 130fc8
# files (the "Software"), to deal in the Software without
Packit 130fc8
# restriction, including without limitation the rights to use, copy,
Packit 130fc8
# modify, merge, publish, distribute, sublicense, and/or sell copies
Packit 130fc8
# of the Software, and to permit persons to whom the Software is
Packit 130fc8
# furnished to do so, subject to the following conditions:
Packit 130fc8
#
Packit 130fc8
# The above copyright notice and this permission notice shall be
Packit 130fc8
# included in all copies or substantial portions of the Software.
Packit 130fc8
#
Packit 130fc8
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
Packit 130fc8
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Packit 130fc8
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Packit 130fc8
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
Packit 130fc8
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
Packit 130fc8
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
Packit 130fc8
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
Packit 130fc8
# DEALINGS IN THE SOFTWARE.
Packit 130fc8
Packit 130fc8
"""Deprecated module which sets the default GLib main context as the mainloop
Packit 130fc8
implementation within D-Bus, as a side-effect of being imported!
Packit 130fc8
Packit 130fc8
This API is highly non-obvious, so instead of importing this module,
Packit 130fc8
new programs which don't need pre-0.80 compatibility should use this
Packit 130fc8
equivalent code::
Packit 130fc8
Packit 130fc8
    from dbus.mainloop.glib import DBusGMainLoop
Packit 130fc8
    DBusGMainLoop(set_as_default=True)
Packit 130fc8
"""
Packit 130fc8
__docformat__ = 'restructuredtext'
Packit 130fc8
Packit 130fc8
from dbus.mainloop.glib import DBusGMainLoop, threads_init
Packit 130fc8
from warnings import warn as _warn
Packit 130fc8
Packit 130fc8
init_threads = threads_init
Packit 130fc8
Packit 130fc8
DBusGMainLoop(set_as_default=True)
Packit 130fc8
Packit 130fc8
_warn(DeprecationWarning("""\
Packit 130fc8
Importing dbus.glib to use the GLib main loop with dbus-python is deprecated.
Packit 130fc8
Instead, use this sequence:
Packit 130fc8
Packit 130fc8
    from dbus.mainloop.glib import DBusGMainLoop
Packit 130fc8
Packit 130fc8
    DBusGMainLoop(set_as_default=True)
Packit 130fc8
"""), DeprecationWarning, stacklevel=2)