Merge pull request #254 from camelot-dev/change-get-backend
Change get backend method for Lattice and run tests
This commit is contained in:
@@ -140,7 +140,11 @@ class Lattice(BaseParser):
|
|||||||
return "convert" in methods
|
return "convert" in methods
|
||||||
|
|
||||||
if isinstance(backend, str):
|
if isinstance(backend, str):
|
||||||
if backend in BACKENDS.keys():
|
if backend not in BACKENDS.keys():
|
||||||
|
raise NotImplementedError(
|
||||||
|
f"Unknown backend '{backend}' specified. Please use either 'poppler' or 'ghostscript'."
|
||||||
|
)
|
||||||
|
|
||||||
if backend == "ghostscript":
|
if backend == "ghostscript":
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
"'ghostscript' will be replaced by 'poppler' as the default image conversion"
|
"'ghostscript' will be replaced by 'poppler' as the default image conversion"
|
||||||
@@ -149,10 +153,6 @@ class Lattice(BaseParser):
|
|||||||
)
|
)
|
||||||
|
|
||||||
return BACKENDS[backend]()
|
return BACKENDS[backend]()
|
||||||
else:
|
|
||||||
raise NotImplementedError(
|
|
||||||
f"Unknown backend '{backend}' specified. Please use either 'poppler' or 'ghostscript'."
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
if not implements_convert():
|
if not implements_convert():
|
||||||
raise NotImplementedError(
|
raise NotImplementedError(
|
||||||
|
|||||||
Reference in New Issue
Block a user