#NEWLINE# def onDrop( self , event ) : #NEWLINE# #INDENT# dt = event . dataTransfer #NEWLINE# types = getTypes ( event ) #NEWLINE# self . addMessage ( ( 'drop types received: ' + ', ' . join ( self ) ) ) #NEWLINE# parent = self . getParent ( ) #NEWLINE# parent . clearContent ( ) #NEWLINE# self . addMessage ( ( 'dt: ' + str ( dt ) ) ) #NEWLINE# types . sort ( ) #NEWLINE# for ctype in types : #NEWLINE# #INDENT# data = dt . getData ( ctype ) #NEWLINE# if ( ctype == 'Files' ) : #NEWLINE# #INDENT# file_names = [ ] #NEWLINE# files = dt . files #NEWLINE# for idx in range ( files . length ) : #NEWLINE# #INDENT# item = files . item ( idx ) #NEWLINE# try : #NEWLINE# #INDENT# name = item . name #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# name = item . fileName #NEWLINE# #UNINDENT# file_names . append ( name ) #NEWLINE# #UNINDENT# data = '<br>' . join ( file_names ) #NEWLINE# #UNINDENT# parent . addContent ( ctype , data ) #NEWLINE# #UNINDENT# DOM . eventPreventDefault ( event ) #NEWLINE# DOM . eventCancelBubble ( event , True )