1
# ServiceInterface.py - interface of BlueZ service plugins
3
# Copyright (C) 2008 Vinicius Gomes <vcgomes [at] gmail [dot] com>
4
# Copyright (C) 2008 Li Dongyang <Jerry87905 [at] gmail [dot] com>
6
# This program is free software; you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 2 of the License, or
9
# (at your option) any later version.
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with this program; if not, write to the Free Software
18
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
from utils import raise_dbus_error
21
from BlueZInterface import BlueZInterface
23
class ServiceInterface(BlueZInterface):
1
from PropertiesBlueZInterface import PropertiesBlueZInterface
2
from errors import raise_dbus_error
5
class ServiceInterface(PropertiesBlueZInterface):
26
7
def __init__(self, interface, obj_path, methods):
27
8
self.methods = methods
28
9
super(ServiceInterface, self).__init__(interface, obj_path)
31
11
def __getattribute__(self, name):
32
12
if name in object.__getattribute__(self, 'methods'):
33
func = getattr(self.GetInterface(), name)
13
func = getattr(self.get_interface(), name)
34
14
return raise_dbus_error(func)
36
return super(ServiceInterface, self).__getattribute__(name)
16
return super(ServiceInterface, self).__getattribute__(name)
b'\\ No newline at end of file'