from cone.app.model import BaseNode from cone.app.model import Metadata from cone.app.model import Properties from cone.app.model import XMLProperties from cone.ugm.localmanager import LocalManagerConfigAttributes from cone.ugm.utils import general_settings from node.utils import instance_property from pyramid.i18n import TranslationStringFactory import os _ = TranslationStringFactory('cone.ugm') ugm_cfg = Properties() ugm_cfg.ugm_settings = '' ugm_cfg.lm_settings = '' # XXX: move cone.ugm.model.factory_defaults here class UGMSettings(BaseNode): config_file = None def __call__(self): self.attrs() @instance_property def attrs(self): config_file = self.config_file if not os.path.isfile(config_file): msg = 'Configuration file {} not exists.'.format(config_file) raise ValueError(msg)