|
@@ -5,7 +5,7 @@ import importlib
|
5
|
5
|
import copy
|
6
|
6
|
|
7
|
7
|
from lodel.utils.mlstring import MlString
|
8
|
|
-from lodel.logger import logger
|
|
8
|
+from lodel import logger
|
9
|
9
|
from lodel.settings import Settings
|
10
|
10
|
from lodel.settings.utils import SettingsError
|
11
|
11
|
|
|
@@ -128,19 +128,26 @@ class EditorialModel(object):
|
128
|
128
|
#EditorialModel.__active_classes attibutes
|
129
|
129
|
def __set_actives(self):
|
130
|
130
|
if Settings.editorialmodel.editormode:
|
|
131
|
+ logger.warning("All EM groups active because editormode in ON")
|
131
|
132
|
# all groups & classes actives because we are in editor mode
|
132
|
133
|
self.__active_groups = self.__groups
|
133
|
134
|
self.__active_classes = self.__classes
|
134
|
135
|
else:
|
135
|
136
|
#determine groups first
|
136
|
137
|
self.__active_groups = dict()
|
|
138
|
+ self.__active_classes = dict()
|
137
|
139
|
for agrp in Settings.editorialmodel.groups:
|
138
|
140
|
if agrp not in self.__groups:
|
139
|
141
|
raise SettingsError('Invalid group found in settings : %s' % agrp)
|
|
142
|
+ logger.debug("Set group '%s' as active" % agrp)
|
140
|
143
|
grp = self.__groups[agrp]
|
141
|
144
|
self.__active_groups[grp.uid] = grp
|
142
|
145
|
for acls in grp.components():
|
143
|
146
|
self.__active_classes[acls.uid] = acls
|
|
147
|
+ if len(self.__active_groups) == 0:
|
|
148
|
+ raise RuntimeError("No groups activated, abording...")
|
|
149
|
+ if len(self.__active_classes) == 0:
|
|
150
|
+ raise RuntimeError("No active class found. Abording")
|
144
|
151
|
|
145
|
152
|
##@brief EmField getter
|
146
|
153
|
# @param uid str : An EmField uid represented by "CLASSUID.FIELDUID"
|