#NEWLINE# def find_imports( self , pbds ) : #NEWLINE# #INDENT# 'Find all missing imports in list of Pbd instances.\n        ' #NEWLINE# imports = list ( set ( self . uses ) . difference ( set ( self . defines ) ) ) #NEWLINE# for imp in imports : #NEWLINE# #INDENT# for p in pbds : #NEWLINE# #INDENT# if ( imp in p . defines ) : #NEWLINE# #INDENT# self . imports . append ( p . name ) #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . imports = list ( set ( self . imports ) ) #NEWLINE# for import_file in self . imports : #NEWLINE# #INDENT# self . lines . insert ( 2 , 'import "{}";' . format ( import_file ) )