diff --git a/manuskript/exporter/basic.py b/manuskript/exporter/basic.py index 22affbd7..4fa4ad26 100644 --- a/manuskript/exporter/basic.py +++ b/manuskript/exporter/basic.py @@ -59,7 +59,7 @@ class basicExporter: run = self.customPath else: print("Error: no command for", self.name) - return + return None r = subprocess.check_output([run] + args) # timeout=.2 return r.decode("utf-8") diff --git a/manuskript/exporter/pandoc/__init__.py b/manuskript/exporter/pandoc/__init__.py index cce3feda..863a6979 100644 --- a/manuskript/exporter/pandoc/__init__.py +++ b/manuskript/exporter/pandoc/__init__.py @@ -48,7 +48,14 @@ class pandocExporter(basicExporter): return "" def convert(self, src, args, outputfile=None): - args = [self.cmd] + args + if self.isValid() == 2: + run = self.cmd + elif self.isValid() == 1: + run = self.customPath + else: + print("Error: no command for pandoc") + return None + args = [run] + args if outputfile: args.append("--output={}".format(outputfile)) diff --git a/manuskript/importer/pandocImporters.py b/manuskript/importer/pandocImporters.py index 023a4b08..6e281cc8 100644 --- a/manuskript/importer/pandocImporters.py +++ b/manuskript/importer/pandocImporters.py @@ -38,6 +38,9 @@ class pandocImporter(abstractImporter): r = pandocExporter().run(args) + if r is None: + return None + if formatTo == "opml": return self.opmlImporter.startImport("", parentItem, settingsWidget, fromString=r)