Fix crash if using a custom pandoc installation

Fixes #563
This commit is contained in:
Youness Alaoui 2019-05-09 14:24:52 -04:00 committed by Curtis Gedak
parent 3dfb43f6c1
commit f1baab8b3a
3 changed files with 12 additions and 2 deletions

View file

@ -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")

View file

@ -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))

View file

@ -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)