@@ -26,14 +26,17 @@ class BaseSection(base.Sectionable):
2626 An odML Section.
2727
2828 :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.
3031 :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.
3134 :param parent: the parent object of the new Section. If the object is not
3235 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.
3437 :param reference: A reference (e.g. an URL) to an external definition
3538 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 .
3740 :param link: Specifies a soft link, i.e. a path within the document.
3841 :param include: Specifies an arbitrary URL. Can only be used if *link* is not set.
3942 :param oid: object id, UUID string as specified in RFC 4122. If no id is provided,
@@ -49,7 +52,7 @@ class BaseSection(base.Sectionable):
4952
5053 _format = fmt .Section
5154
52- def __init__ (self , name = None , type = None , parent = None ,
55+ def __init__ (self , name = None , type = "n.s." , parent = None ,
5356 definition = None , reference = None ,
5457 repository = None , link = None , include = None , oid = None ):
5558
@@ -84,7 +87,9 @@ def __init__(self, name=None, type=None, parent=None,
8487
8588 for err in validation .Validation (self ).errors :
8689 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 )
8893 print (msg )
8994
9095 def __repr__ (self ):
0 commit comments