Coverage for /home/antoine/projects/xpra-git/dist/python3/lib64/python/xpra/dbus/common.py : 96%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# This file is part of Xpra.
2# Copyright (C) 2011-2013 Antoine Martin <antoine@xpra.org>
3# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
4# later version. See the file COPYING for details.
6_loop = None
7def loop_init():
8 global _loop
9 if not _loop:
10 from dbus.mainloop.glib import DBusGMainLoop, threads_init
11 threads_init()
12 _loop = DBusGMainLoop(set_as_default=True)
13 return _loop
15_session_bus = None
16def init_session_bus(private=False):
17 global _session_bus
18 if _session_bus and not private:
19 return _session_bus
20 loop_init()
21 import dbus
22 _session_bus = dbus.SessionBus(private=private)
23 return _session_bus
25_system_bus = None
26def init_system_bus():
27 global _system_bus
28 if _system_bus:
29 return _system_bus
30 loop_init()
31 import dbus
32 _system_bus = dbus.SystemBus()
33 return _system_bus