#NEWLINE# def __init__( self , xml_obj = None , raw_mode = False ) : #NEWLINE# #INDENT# self . raw_mode = raw_mode #NEWLINE# self . _layer_name = xml_obj . attrib [ 'name' ] #NEWLINE# self . _all_fields = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for field in xml_obj . findall ( './/field' ) : #NEWLINE# #INDENT# attributes = dict ( field . attrib ) #NEWLINE# field_obj = LayerField ( ** raw_mode ) #NEWLINE# if ( attributes [ 'name' ] in self . _all_fields ) : #NEWLINE# #INDENT# self . _all_fields [ attributes [ 'name' ] ] . add_field ( field_obj ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _all_fields [ attributes [ 'name' ] ] = LayerFieldsContainer ( field_obj )