#NEWLINE# def drop_event( self , widget , event ) : #NEWLINE# #INDENT# dropdata = event . mimeData ( ) #NEWLINE# formats = list ( map ( str , list ( dropdata . formats ( ) ) ) ) #NEWLINE# self . logger . debug ( ( 'available formats of dropped data are %s' % formats ) ) #NEWLINE# if ( 'text/thumb' in formats ) : #NEWLINE# #INDENT# if six . PY2 : #NEWLINE# #INDENT# thumbstr = str ( dropdata . data ( 'text/thumb' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# thumbstr = str ( dropdata . data ( 'text/thumb' ) , encoding = 'ascii' ) #NEWLINE# #UNINDENT# data = [ thumbstr ] #NEWLINE# self . logger . debug ( ( 'dropped thumb(s): %s' % str ( data ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if dropdata . hasUrls ( ) : #NEWLINE# #INDENT# urls = list ( dropdata . urls ( ) ) #NEWLINE# data = [ str ( url . toString ( ) ) for url in urls ] #NEWLINE# self . logger . debug ( ( 'dropped filename(s): %s' % str ( data ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'text/plain' in dropdata ) : #NEWLINE# #INDENT# data = [ dropdata . text ( ) ] #NEWLINE# self . logger . debug ( ( 'dropped filename(s): %s' % str ( data ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# event . setAccepted ( False ) #NEWLINE# return #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# event . setAccepted ( True ) #NEWLINE# self . make_ui_callback ( 'drag-drop' , data )