Browse Source

Bugfix in utility script

Yann Weber 8 years ago
parent
commit
2628e67982

+ 7
- 4
em_test.py View File

@@ -1,7 +1,9 @@
1
+#!/usr/bin/python3
1 2
 #-*- coding: utf-8 -*-
2 3
 
3
-from lodel.settings.settings import Settings as SettingsHandler
4
-SettingsHandler('globconf.d')
4
+from lodel.settings.settings import Settings as settings
5
+settings('globconf.d')
6
+from lodel.settings import Settings
5 7
 
6 8
 from lodel.editorial_model.components import *
7 9
 from lodel.editorial_model.exceptions import *
@@ -204,14 +206,14 @@ section.new_field(  'childs',
204 206
                     display_name = 'Next section',
205 207
                     group = editorial_group,
206 208
                     data_handler = 'hierarch',
207
-                    allowed_class = [subsection],
209
+                    allowed_classes = [subsection],
208 210
                     back_reference = ('subsection', 'parent'))
209 211
 
210 212
 subsection.new_field(   'parent',
211 213
                         display_name = 'Parent',
212 214
                         group = editorial_group,
213 215
                         data_handler = 'link',
214
-                        allowed_class = [section])
216
+                        allowed_classes = [section])
215 217
 
216 218
 #####################
217 219
 # Persons & authors #
@@ -286,4 +288,5 @@ text.new_field( 'linked_persons',
286 288
                 group = editorial_person_group,
287 289
 )
288 290
 
291
+#em.save('xmlfile', filename = 'examples/em_test.xml')
289 292
 em.save('picklefile', filename = 'examples/em_test.pickle')

BIN
examples/em_test.pickle View File


+ 0
- 10
globconf.d/global.ini View File

@@ -1,10 +0,0 @@
1
-[lodel2]
2
-plugins_path = plugins
3
-
4
-[lodel2.editorialmodel]
5
-emfile = examples/em_test.pickle
6
-emtranslator = picklefile
7
-dyncode = lodel/leapi/dyncode.py
8
-editormode = True
9
-groups = 
10
-

+ 17
- 0
globconf.d/lodel2.ini View File

@@ -0,0 +1,17 @@
1
+[lodel2]
2
+debug = False
3
+sitename = noname
4
+plugins_path = plugins
5
+plugins = dummy, webui
6
+
7
+[lodel2.logging.stderr]
8
+level = DEBUG
9
+filename = -
10
+context = True
11
+
12
+[lodel2.editorialmodel]
13
+groups = 
14
+emfile = examples/em_test.pickle
15
+dyncode = leapi_dyncode.py
16
+editormode = True
17
+

+ 0
- 10
globconf.d/loggers.ini View File

@@ -1,10 +0,0 @@
1
-[lodel2.logging.stderr]
2
-level = INFO
3
-context = False
4
-
5
-[lodel2.logging.logfile]
6
-level = DEBUG
7
-context = True
8
-filename = /tmp/lodel2.log
9
-maxbytes = 4096
10
-backupcount = 1

BIN
tests/editorial_model.pickle View File


+ 17
- 0
tests/tests_conf.d/lodel2.ini View File

@@ -0,0 +1,17 @@
1
+[lodel2]
2
+debug = False
3
+sitename = noname
4
+plugins_path = plugins
5
+plugins = dummy, webui
6
+
7
+[lodel2.logging.stderr]
8
+level = DEBUG
9
+filename = -
10
+context = True
11
+
12
+[lodel2.editorialmodel]
13
+groups = 
14
+emfile = editorial_model.pickle
15
+dyncode = leapi_dyncode.py
16
+editormode = True
17
+

Loading…
Cancel
Save