def ImportFromDragDrop(self, paths): from hydrus.client.gui import ClientGUIDialogsQuick message = 'Try to import the {} dropped files to this list? I am expecting json or png files.'.format( HydrusData.ToHumanInt(len(paths))) result = ClientGUIDialogsQuick.GetYesNo(self, message) if result == QW.QDialog.Accepted: (jsons, pngs) = HydrusData.PartitionIteratorIntoLists( lambda path: path.endswith('.png'), paths) self._ImportPNGs(pngs) self._ImportJSONs(jsons) self._listctrl.Sort()