@@ -26,14 +26,17 @@ class BaseSection(base.Sectionable):
26
26
An odML Section.
27
27
28
28
:param name: string providing the name of the Section. If the name is not
29
- provided, the uuid of the Property is assigned as its name.
29
+ provided, the object id of the Section is assigned as its name.
30
+ Section name is a required attribute.
30
31
:param type: String providing a grouping description for similar Sections.
32
+ Section type is a required attribute and will be set to the string
33
+ 'n.s.' by default.
31
34
:param parent: the parent object of the new Section. If the object is not
32
35
an odml.Section or an odml.Document, a ValueError is raised.
33
- :param definition: String describing the definition of the Section.
36
+ :param definition: String defining this Section.
34
37
:param reference: A reference (e.g. an URL) to an external definition
35
38
of the Section.
36
- :param repository: URL to a repository where this Section can be found .
39
+ :param repository: URL to a repository in which the Section is defined .
37
40
:param link: Specifies a soft link, i.e. a path within the document.
38
41
:param include: Specifies an arbitrary URL. Can only be used if *link* is not set.
39
42
:param oid: object id, UUID string as specified in RFC 4122. If no id is provided,
@@ -49,7 +52,7 @@ class BaseSection(base.Sectionable):
49
52
50
53
_format = fmt .Section
51
54
52
- def __init__ (self , name = None , type = None , parent = None ,
55
+ def __init__ (self , name = None , type = "n.s." , parent = None ,
53
56
definition = None , reference = None ,
54
57
repository = None , link = None , include = None , oid = None ):
55
58
@@ -84,7 +87,9 @@ def __init__(self, name=None, type=None, parent=None,
84
87
85
88
for err in validation .Validation (self ).errors :
86
89
if err .is_error :
87
- msg = "\n \t - %s %s: %s" % (err .obj , err .rank , err .msg )
90
+ use_name = err .obj .name if err .obj .id != err .obj .name else None
91
+ sec_formatted = "Section[id=%s|%s/%s]" % (err .obj .id , use_name , err .obj .type )
92
+ msg = "%s\n Validation[%s]: %s" % (sec_formatted , err .rank , err .msg )
88
93
print (msg )
89
94
90
95
def __repr__ (self ):
0 commit comments