MCPcopy Create free account
hub / github.com/scanny/python-pptx / __init__

Method __init__

lab/parse_xsd/parse_xsd.py:279–291  ·  view source on GitHub ↗
(self, attribute_elm)

Source from the content-addressed store, hash-verified

277 <xsd:attribute> object
278 """
279 def __init__(self, attribute_elm):
280 super(Attribute, self).__init__()
281 self.name = attribute_elm.get('name')
282 self.type = attribute_elm.get('type')
283 self.use = attribute_elm.get('use', 'optional')
284 self.default = attribute_elm.get('default')
285 self.ref = attribute_elm.get('ref')
286 self.form = attribute_elm.get('form')
287 if self.form is not None:
288 raise TypeError('found xsd:attribute with form="%s"' % self.form)
289 # don't care about details other than name, ref gives that
290 if self.name is None:
291 self.name = self.ref
292
293 def __str__(self):
294 cardinality = '?' if self.use == 'optional' else '1'

Callers

nothing calls this directly

Calls 2

__init__Method · 0.45
getMethod · 0.45

Tested by

no test coverage detected