示例#1
0
    def get_advanced_config(self):
        path = os.path.join(config.data_path, "advanced_settings.json")
        if os.path.isfile(path):
            data = FileIO.read(path, "r")

            return Dicked(**jstyleson.loads(data))

        return Dicked()
示例#2
0
    def get_advanced_config(self):
        paths = []
        if Prefs['path_to_advanced_settings']:
            paths = [
                Prefs['path_to_advanced_settings'],
                os.path.join(Prefs['path_to_advanced_settings'], "advanced_settings.json")
            ]

        paths.append(os.path.join(config.data_path, "advanced_settings.json"))

        for path in paths:
            if os.path.isfile(path):
                data = FileIO.read(path, "r")

                d = Dicked(**jstyleson.loads(data))
                self.adv_cfg_path = path
                Log.Info(u"Using advanced settings from: %s", path)
                return d

        return Dicked()