def pathFor(self, filename): dst = Meta.newThumbnail(filename) self._zipobj.extract(filename, os.path.dirname(dst)) os.rename(os.path.join(os.path.dirname(dst), filename), dst) return dst
def dropEvent(self, event): src = event.mimeData().urls()[0].toLocalFile() dst = Meta.newThumbnail(src) shutil.copyfile(src, dst) cmd = commands.ChangeConfigurationThumbnailCommand(configuration=self.configuration(), filename=dst) self.history().run(cmd)