Mercurial > libervia-backend
diff src/core/sat_main.py @ 364:312ca6f9d84a
core: configuration file
SàT's main options can now be put in a configuration file which can be in different locations
Bridge: new getConfig option
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 18 Jun 2011 16:22:50 +0200 |
parents | f147b778511a |
children | efbfccfed623 |
line wrap: on
line diff
--- a/src/core/sat_main.py Sun Jun 12 23:43:36 2011 +0200 +++ b/src/core/sat_main.py Sat Jun 18 16:22:50 2011 +0200 @@ -97,20 +97,22 @@ def __init__(self): #TODO: standardize callback system - local_dir = os.path.expanduser(self.get_const('local_dir')) - if not os.path.exists(local_dir): - os.makedirs(local_dir) - self.__waiting_conf = {} #callback called when a confirmation is received self.__progress_cb_map = {} #callback called when a progress is requested (key = progress id) self.__general_cb_map = {} #callback called for general reasons (key = name) self.__private_data = {} #used for internal callbacks (key = id) - self.trigger = TriggerManager() #trigger are used to change SàT behaviour self.profiles = {} self.plugins = {} self.menus = {} #used to know which new menus are wanted by plugins self.memory=Memory(self) + + local_dir = os.path.expanduser(self.get_const('local_dir')) + if not os.path.exists(local_dir): + os.makedirs(local_dir) + + self.trigger = TriggerManager() #trigger are used to change SàT behaviour + self.bridge=DBusBridge() self.bridge.register("getVersion", lambda: self.get_const('client_version')) @@ -126,6 +128,7 @@ self.bridge.register("getPresenceStatus", self.memory.getPresenceStatus) self.bridge.register("getWaitingSub", self.memory.getWaitingSub) self.bridge.register("sendMessage", self.sendMessage) + self.bridge.register("getConfig", self.memory.getConfig) self.bridge.register("setParam", self.setParam) self.bridge.register("getParamA", self.memory.getParamA) self.bridge.register("getParamsUI", self.memory.getParamsUI)