Update Meme Generator project
This commit is contained in:
@@ -19,5 +19,6 @@ class IngestorInterface(ABC):
|
||||
@classmethod
|
||||
@abstractmethod
|
||||
def parse(cls, path: str) -> List[QuoteModel]:
|
||||
"""Abstract method to parse the file and return a list of QuoteModel objects."""
|
||||
"""Abstract method to parse the file and return a list of QuoteModel
|
||||
objects."""
|
||||
pass
|
||||
|
||||
@@ -23,7 +23,7 @@ class PDFIngestor(IngestorInterface):
|
||||
tmp = f"./tmp/{random.randint(0, 10000)}.txt"
|
||||
try:
|
||||
# pdftotext <input-pdf> <output-text-file>
|
||||
call = subprocess.call(["pdftotext", path, tmp])
|
||||
subprocess.call(["pdftotext", path, tmp])
|
||||
with open(tmp, "r") as file:
|
||||
lines = file.readlines()
|
||||
except FileNotFoundError as err:
|
||||
|
||||
@@ -10,5 +10,5 @@ class QuoteModel:
|
||||
self.author = author
|
||||
|
||||
def __repr__(self):
|
||||
"""String representation of the QuoteModel object."""
|
||||
"""Return a string representation of the QuoteModel."""
|
||||
return f"{self.body} - {self.author}"
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
"""QuoteEngine package.
|
||||
|
||||
Provides tools for parsing and representing quote data.
|
||||
"""
|
||||
|
||||
from .IngestorInterface import IngestorInterface
|
||||
from .CSVIngestor import CSVIngestor
|
||||
from .DocxIngestor import DocxIngestor
|
||||
|
||||
Reference in New Issue
Block a user