def init(self): super().init() widget_settings_dir_cfg = environ.get_path("widget_settings_dir", "") if widget_settings_dir_cfg: # widget_settings_dir is configured via config file set_widget_settings_dir_components(widget_settings_dir_cfg, self.ApplicationVersion) canvas_settings_dir_cfg = environ.get_path("canvas_settings_dir", "") if canvas_settings_dir_cfg: # canvas_settings_dir is configured via config file QSettings.setPath(QSettings.IniFormat, QSettings.UserScope, canvas_settings_dir_cfg) for t in spec: occonfig.register_setting(*t)
def log_dir(): """ Return the application log directory. """ if sys.platform == "darwin": name = Config.ApplicationName logdir = os.path.join(os.path.expanduser("~/Library/Logs"), name) else: logdir = data_dir() logdir = environ.get_path("log_dir", logdir) try: os.makedirs(logdir, exist_ok=True) except OSError: pass return logdir