@@ -63,14 +63,22 @@ def namespaces(self):
63
63
64
64
@property
65
65
def elements (self ):
66
- """Yield all globla xsd.Type objects"""
66
+ """Yield all globla xsd.Type objects
67
+
68
+ :rtype: Iterable of zeep.xsd.Element
69
+
70
+ """
67
71
for document in self .documents :
68
72
for element in document ._elements .values ():
69
73
yield element
70
74
71
75
@property
72
76
def types (self ):
73
- """Yield all globla xsd.Type objects"""
77
+ """Yield all global xsd.Type objects
78
+
79
+ :rtype: Iterable of zeep.xsd.ComplexType
80
+
81
+ """
74
82
for document in self .documents :
75
83
for type_ in document ._types .values ():
76
84
yield type_
@@ -94,12 +102,20 @@ def add_documents(self, schema_nodes, location):
94
102
self ._prefix_map_auto = self ._create_prefix_map ()
95
103
96
104
def get_element (self , qname ):
97
- """Return a global xsd.Element object with the given qname"""
105
+ """Return a global xsd.Element object with the given qname
106
+
107
+ :rtype: zeep.xsd.Group
108
+
109
+ """
98
110
qname = self ._create_qname (qname )
99
111
return self ._get_instance (qname , 'get_element' , 'element' )
100
112
101
113
def get_type (self , qname , fail_silently = False ):
102
- """Return a global xsd.Type object with the given qname"""
114
+ """Return a global xsd.Type object with the given qname
115
+
116
+ :rtype: zeep.xsd.ComplexType or zeep.xsd.AnySimpleType
117
+
118
+ """
103
119
qname = self ._create_qname (qname )
104
120
try :
105
121
return self ._get_instance (qname , 'get_type' , 'type' )
@@ -110,15 +126,27 @@ def get_type(self, qname, fail_silently=False):
110
126
raise
111
127
112
128
def get_group (self , qname ):
113
- """Return a global xsd.Group object with the given qname"""
129
+ """Return a global xsd.Group object with the given qname.
130
+
131
+ :rtype: zeep.xsd.Group
132
+
133
+ """
114
134
return self ._get_instance (qname , 'get_group' , 'group' )
115
135
116
136
def get_attribute (self , qname ):
117
- """Return a global xsd.attributeGroup object with the given qname"""
137
+ """Return a global xsd.attributeGroup object with the given qname
138
+
139
+ :rtype: zeep.xsd.Attribute
140
+
141
+ """
118
142
return self ._get_instance (qname , 'get_attribute' , 'attribute' )
119
143
120
144
def get_attribute_group (self , qname ):
121
- """Return a global xsd.attributeGroup object with the given qname"""
145
+ """Return a global xsd.attributeGroup object with the given qname
146
+
147
+ :rtype: zeep.xsd.AttributeGroup
148
+
149
+ """
122
150
return self ._get_instance (qname , 'get_attribute_group' , 'attributeGroup' )
123
151
124
152
def set_ns_prefix (self , prefix , namespace ):
@@ -201,6 +229,8 @@ def _create_qname(self, name):
201
229
202
230
This also expands the shorthand notation.
203
231
232
+ :rtype: lxml.etree.QNaame
233
+
204
234
"""
205
235
if isinstance (name , etree .QName ):
206
236
return name
@@ -231,6 +261,11 @@ def _create_prefix_map(self):
231
261
return prefix_map
232
262
233
263
def _has_schema_document (self , namespace ):
264
+ """Return a boolean if there is a SchemaDocumnet for the namespace.
265
+
266
+ :rtype: boolean
267
+
268
+ """
234
269
return namespace in self ._documents
235
270
236
271
def _add_schema_document (self , document ):
@@ -239,11 +274,22 @@ def _add_schema_document(self, document):
239
274
documents .append (document )
240
275
241
276
def _get_schema_document (self , namespace , location ):
277
+ """Return a list of SchemaDocument's for the given namespace AND
278
+ location.
279
+
280
+ :rtype: SchemaDocument
281
+
282
+ """
242
283
for document in self ._documents .get (namespace , []):
243
284
if document ._location == location :
244
285
return document
245
286
246
287
def _get_schema_documents (self , namespace , fail_silently = False ):
288
+ """Return a list of SchemaDocument's for the given namespace.
289
+
290
+ :rtype: list of SchemaDocument
291
+
292
+ """
247
293
if namespace not in self ._documents :
248
294
if fail_silently :
249
295
return []
@@ -370,23 +416,43 @@ def register_attribute_group(self, name, value):
370
416
self ._attribute_groups [name ] = value
371
417
372
418
def get_type (self , qname ):
373
- """Return a xsd.Type object from this schema"""
419
+ """Return a xsd.Type object from this schema
420
+
421
+ :rtype: zeep.xsd.ComplexType or zeep.xsd.AnySimpleType
422
+
423
+ """
374
424
return self ._get_instance (qname , self ._types , 'type' )
375
425
376
426
def get_element (self , qname ):
377
- """Return a xsd.Element object from this schema"""
427
+ """Return a xsd.Element object from this schema
428
+
429
+ :rtype: zeep.xsd.Element
430
+
431
+ """
378
432
return self ._get_instance (qname , self ._elements , 'element' )
379
433
380
434
def get_group (self , qname ):
381
- """Return a xsd.Group object from this schema"""
435
+ """Return a xsd.Group object from this schema.
436
+
437
+ :rtype: zeep.xsd.Group
438
+
439
+ """
382
440
return self ._get_instance (qname , self ._groups , 'group' )
383
441
384
442
def get_attribute (self , qname ):
385
- """Return a xsd.Attribute object from this schema"""
443
+ """Return a xsd.Attribute object from this schema
444
+
445
+ :rtype: zeep.xsd.Attribute
446
+
447
+ """
386
448
return self ._get_instance (qname , self ._attributes , 'attribute' )
387
449
388
450
def get_attribute_group (self , qname ):
389
- """Return a xsd.AttributeGroup object from this schema"""
451
+ """Return a xsd.AttributeGroup object from this schema
452
+
453
+ :rtype: zeep.xsd.AttributeGroup
454
+
455
+ """
390
456
return self ._get_instance (qname , self ._attribute_groups , 'attributeGroup' )
391
457
392
458
def _get_instance (self , qname , items , item_name ):
0 commit comments