openpack/basepack.py
def from_element(cls, element):
		"given an element, parse out the proper ContentType"
		# disambiguate the subclass
		ns, class_name = parse_tag(element.tag)
		class_ = getattr(ContentType, class_name)
		if not class_:
			msg = 'Invalid Types child element: %(class_name)s' % vars()
			raise ValueError(msg)
		# construct the subclass
		key = element.get(class_.key_name)
		name = element.get('ContentType')
		return class_(name, key)
def from_element(cls, element):
		"given an element, parse out the proper ContentType"
		# disambiguate the subclass
		ns, class_name = parse_tag(element.tag)
		class_ = getattr(ContentType, class_name)
		if not class_:
			msg = 'Invalid Types child element: %(class_name)s' % vars()
			raise ValueError(msg)
		# construct the subclass
		key = element.get(class_.key_name)
		name = element.get('ContentType')
		return class_(name, key)
def from_element ( cls , element ) : # disambiguate the subclass ns , class_name = parse_tag ( element . tag ) class_ = getattr ( ContentType , class_name ) if not class_ : msg = 'Invalid Types child element: %(class_name)s' % vars ( ) raise ValueError ( msg ) # construct the subclass key = element . get ( class_ . key_name ) name = element . get ( 'ContentType' ) return class_ ( name , key )
given an element, parse out the proper ContentType
given an element parse out the proper ContentType