blob: 5fdb8a294d392ad3ab8900506b0217fb54437436 [file] [log] [blame]
#!/usr/bin/env python
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import dbus
import dbus.service
from swindle import entity
class Profile(entity.Entity):
_I_PROFILE = 'org.chromium.flimflam.Profile'
def __init__(self, bus, name):
entity.Entity.__init__(self, bus, '/profile/%s' % name) = name
self._services = []
def spath(self, srv):
return '%s/%s' % (self._object_path, srv)
def is_favorite(self):
return False
def services(self):
return dbus.Array([x.path() for x in self._services], variant_level=1)
def add_service(self, srv):
def del_service(self, srv):
def active(self):
if not
return False
return reduce(lambda x, y: x or y, [ for x in self._services])
@dbus.service.method(_I_PROFILE, in_signature='', out_signature='a{sv}')
def GetProperties(self):
r = {}
r['OfflineMode'] = dbus.Boolean(not, variant_level=1)
r['Services'] =
r['Entries'] = dbus.Array([ for x in],
return r
@dbus.service.method(_I_PROFILE, in_signature='sv', out_signature='')
def SetProperty(self, key, val):
self.log('SetProperty %s %s', key, val)
@dbus.service.signal(_I_PROFILE, signature='sv')
def PropertyChanged(self, key, val):
self.log('PropertyChanged %s %s', key, val)