def strip_filenames(descriptor):
 print 'strip filename from {desc}'.format(desc=descriptor.location.to_deprecated_string())
 if descriptor._field_data.has(descriptor, 'filename'):
  descriptor._field_data.delete(descriptor, 'filename')
 if hasattr(descriptor, 'xml_attributes'):
  if ('filename' in descriptor.xml_attributes):
   del descriptor.xml_attributes['filename']
 for child in descriptor.get_children():
  strip_filenames(child)
 descriptor.save()

def strip_filenames ( descriptor ) : print 'strip filename from {desc}' . format ( desc = descriptor . location . to_deprecated_string ( ) ) if descriptor . _field_data . has ( descriptor , 'filename' ) : descriptor . _field_data . delete ( descriptor , 'filename' ) if hasattr ( descriptor , 'xml_attributes' ) : if ( 'filename' in descriptor . xml_attributes ) : del descriptor . xml_attributes [ 'filename' ] for child in descriptor . get_children ( ) : strip_filenames ( child ) descriptor . save ( )
recursively strips filename from all childrens definitions .