def exportFile(self): params, ok = ExportDialog.getExportParameters(self, self._font) if not ok: return baseName = params["baseName"] directory = params["exportDirectory"] compression = set(map(str.lower, params["compression"])) for format in map(str.lower, params["formats"]): fileName = f"{baseName}.{format}" path = os.path.join(directory, fileName) try: self._font.export(path, format, compression=compression) except Exception as e: msg = (self.tr("This font’s feature file contains an error.") if isinstance(e, FeatureLibError) else None) errorReports.showCriticalException(e, message=msg)
def exportFile(self): params, ok = ExportDialog.getExportParameters(self, self._font) if not ok: return baseName = params['baseName'] directory = params['exportDirectory'] compression = set(map(str.lower, params['compression'])) for format in map(str.lower, params['formats']): fileName = "{}.{}".format(baseName, format) path = os.path.join(directory, fileName) try: self._font.export(path, format, compression=compression) except Exception as e: msg = self.tr("This font’s feature file contains an error." ) if isinstance(e, FeatureLibError) else None errorReports.showCriticalException(e, message=msg)