Simplify dbus_bindings backwards compatibility glue
[dbus-python-phuang.git] / dbus / gobject_service.py
blob2a9fbd8627f15d972edee2dd0bbde90aafd3ce4e
1 """Support code for implementing D-Bus services via GObjects."""
3 # Copyright (C) 2007 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 Library General Public License as published by
9 # the Free Software Foundation; either version 2.1 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 Library General Public License for more details.
17 # You should have received a copy of the GNU Library 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 import gobject
22 import dbus.service
24 class ExportedGObjectType(dbus.service.InterfaceType, gobject.GObjectMeta):
25 """A metaclass which inherits from both GObjectMeta and
26 `dbus.service.InterfaceType`. Used as the metaclass for `ExportedGObject`.
27 """
29 class ExportedGObject(dbus.service.Object, gobject.GObject):
30 """A GObject which is exported on the D-Bus.
32 Because GObject and `dbus.service.Object` both have custom metaclasses,
33 the naive approach using simple multiple inheritance won't work. This
34 class has `ExportedGObjectType` as its metaclass, which is sufficient
35 to make it work correctly.
36 """
37 __metaclass__ = ExportedGObjectType