Skip to content

Commit 6e09524

Browse files
author
Gerit Wagner
committed
tei-parser: input as str or Path
1 parent a546e7c commit 6e09524

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

colrev/env/tei_parser.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ class TEIParser:
4848
def __init__(
4949
self,
5050
*,
51-
pdf_path: typing.Optional[Path] = None,
52-
tei_path: typing.Optional[Path] = None,
51+
pdf_path: typing.Optional[typing.Union[Path, str]] = None,
52+
tei_path: typing.Optional[typing.Union[Path, str]] = None,
5353
):
5454
"""Creates a TEI file
5555
modes of operation:
@@ -60,8 +60,13 @@ def __init__(
6060
# pylint: disable=consider-using-with
6161
assert pdf_path is not None or tei_path is not None
6262
if pdf_path is not None:
63+
pdf_path = Path(pdf_path)
6364
if pdf_path.is_symlink(): # pragma: no cover
6465
pdf_path = pdf_path.resolve()
66+
67+
if tei_path is not None:
68+
tei_path = Path(tei_path)
69+
6570
self.pdf_path = pdf_path
6671
self.tei_path = tei_path
6772
if pdf_path is not None and not pdf_path.is_file():

0 commit comments

Comments
 (0)