dbus: fix active profile
This commit is contained in:
parent
5cdd115ef0
commit
070a9a234a
3 changed files with 6 additions and 6 deletions
|
|
@ -95,7 +95,7 @@ class Controller(exports.interfaces.ExportableInterface):
|
|||
|
||||
@exports.export("", "s")
|
||||
def active_profile(self):
|
||||
return self._profile
|
||||
return self._daemon.profile.name
|
||||
|
||||
@exports.export("", "b")
|
||||
def status(self):
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@ class Daemon(object):
|
|||
raise Exception("Cannot set profile while the daemon is running.")
|
||||
self._profile = self._profile_loader.load(profile_name)
|
||||
|
||||
@property
|
||||
def profile(self):
|
||||
return self._profile
|
||||
|
||||
def _thread_code(self):
|
||||
if self._profile is None:
|
||||
raise Exception("Cannot start the daemon without setting a profile.")
|
||||
|
|
@ -113,7 +117,3 @@ class Daemon(object):
|
|||
self._thread = None
|
||||
|
||||
return True
|
||||
|
||||
def cleanup(self):
|
||||
# TODO: do we need it?
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class Loader(object):
|
|||
return self._load_directories
|
||||
|
||||
def load(self, profile_names):
|
||||
if type(profile_names) is str:
|
||||
if type(profile_names) is not list:
|
||||
readable_name = profile_names
|
||||
profile_names = [profile_names]
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue