#NEWLINE# def _get_node_attr( node , attr , default = False ) : #NEWLINE# #INDENT# '\n    :param default: False means value is required\n    ' #NEWLINE# if node . hasAttribute ( attr ) : #NEWLINE# #INDENT# return str ( node . getAttribute ( attr ) ) #NEWLINE# #UNINDENT# if ( default is False ) : #NEWLINE# #INDENT# raise InvalidPackage ( ( 'The "%s" tag must have the attribute "%s"' % ( default . tagName , attr ) ) ) #NEWLINE# #UNINDENT# return default