def paths_from_event(self, event):
 md = event.mimeData()
 if (md.hasFormat(u'text/uri-list') and (not md.hasFormat(u'application/calibre+from_library'))):
  urls = [unicode(u.toLocalFile()) for u in md.urls()]
  return [u for u in urls if (os.path.splitext(u)[1] and os.path.exists(u))]

def paths_from_event ( self , event ) : md = event . mimeData ( ) if ( md . hasFormat ( u'text/uri-list' ) and ( not md . hasFormat ( u'application/calibre+from_library' ) ) ) : urls = [ unicode ( u . toLocalFile ( ) ) for u in md . urls ( ) ] return [ u for u in urls if ( os . path . splitext ( u ) [ 1 ] and os . path . exists ( u ) ) ]
accept a drop event and return a list of paths that can be read from and represent files with extensions .