<s> __copyright__ = "<STR_LIT>" <EOL> import wx <EOL> class FileDropTarget ( wx . FileDropTarget ) : <EOL> def __init__ ( self , callback , filenameFilter = None ) : <EOL> super ( FileDropTarget , self ) . __init__ ( ) <EOL> self . callback = callback <EOL> self . filenameFilter = filenameFilter <EOL> def OnDropFiles ( self , x , y , files ) : <EOL> filteredList = [ ] <EOL> if self . filenameFilter is not None : <EOL> for f in files : <EOL> for ext in self . filenameFilter : <EOL> if f . endswith ( ext ) or f . endswith ( ext . upper ( ) ) : <EOL> filteredList . append ( f ) <EOL> else : <EOL> filteredList = files <EOL> if len ( filteredList ) > <NUM_LIT:0> : <EOL> self . callback ( filteredList ) </s>
