|
@@ -176,7 +176,7 @@ class EditorialModel(object):
|
176
|
176
|
# @param emclass EmClass : the EmClass instance to add
|
177
|
177
|
# @return emclass
|
178
|
178
|
def add_class(self, emclass):
|
179
|
|
- assert_edit()()
|
|
179
|
+ assert_edit()
|
180
|
180
|
if not isinstance(emclass, EmClass):
|
181
|
181
|
raise ValueError("<class EmClass> expected but got %s " % type(emclass))
|
182
|
182
|
if emclass.uid in self.classes():
|
|
@@ -188,7 +188,7 @@ class EditorialModel(object):
|
188
|
188
|
# @param emgroup EmGroup : the EmGroup instance to add
|
189
|
189
|
# @return emgroup
|
190
|
190
|
def add_group(self, emgroup):
|
191
|
|
- assert_edit()()
|
|
191
|
+ assert_edit()
|
192
|
192
|
if not isinstance(emgroup, EmGroup):
|
193
|
193
|
raise ValueError("<class EmGroup> expected but got %s" % type(emgroup))
|
194
|
194
|
if emgroup.uid in self.groups():
|
|
@@ -201,7 +201,7 @@ class EditorialModel(object):
|
201
|
201
|
#@param **kwargs : EmClass constructor options (
|
202
|
202
|
# see @ref lodel.editorial_model.component.EmClass.__init__() )
|
203
|
203
|
def new_class(self, uid, **kwargs):
|
204
|
|
- assert_edit()()
|
|
204
|
+ assert_edit()
|
205
|
205
|
return self.add_class(EmClass(uid, **kwargs))
|
206
|
206
|
|
207
|
207
|
##@brief Add a new EmGroup to the editorial model
|
|
@@ -209,14 +209,14 @@ class EditorialModel(object):
|
209
|
209
|
#@param *kwargs : EmGroup constructor keywords arguments (
|
210
|
210
|
# see @ref lodel.editorial_model.component.EmGroup.__init__() )
|
211
|
211
|
def new_group(self, uid, **kwargs):
|
212
|
|
- assert_edit()()
|
|
212
|
+ assert_edit()
|
213
|
213
|
return self.add_group(EmGroup(uid, **kwargs))
|
214
|
214
|
|
215
|
215
|
##@brief Save a model
|
216
|
216
|
# @param translator module : The translator module to use
|
217
|
217
|
# @param **translator_args
|
218
|
218
|
def save(self, translator, **translator_kwargs):
|
219
|
|
- assert_edit()()
|
|
219
|
+ assert_edit()
|
220
|
220
|
if isinstance(translator, str):
|
221
|
221
|
translator = self.translator_from_name(translator)
|
222
|
222
|
return translator.save(self, **translator_kwargs)
|