dbus/proxies.py: Give Interface some properties. Vastly simplify __getattr__ on Inter...
[dbus-python-phuang.git] / dbus / mainloop / glib.py
blob88a6c5b20851bc898abf16ba186254586871849d
1 # Copyright (C) 2004 Anders Carlsson
2 # Copyright (C) 2004, 2005, 2006 Red Hat Inc. <http://www.redhat.com/>
3 # Copyright (C) 2005, 2006 Collabora Ltd. <http://www.collabora.co.uk/>
5 # Licensed under the Academic Free License version 2.1
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 """GLib main loop integration using libdbus-glib."""
23 __all__ = ('DBusGMainLoop', 'threads_init')
25 from _dbus_glib_bindings import DBusGMainLoop, gthreads_init
27 _dbus_gthreads_initialized = False
28 def threads_init():
29 """Initialize threads in dbus-glib, if this has not already been done.
31 This must be called before creating a second thread in a program that
32 uses this module.
33 """
34 global _dbus_gthreads_initialized
35 if not _dbus_gthreads_initialized:
36 gthreads_init()
37 _dbus_gthreads_initialized = True