diff --git a/Dockerfile b/Dockerfile index 94840f3..e5b12d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,8 @@ FROM python:3 -WORKDIR /usr/src/app - RUN curl https://xpdfreader-dl.s3.amazonaws.com/old/xpdf-3.04.tar.gz | tar xz RUN chmod -R 755 ./xpdf-3.04 && cd ./xpdf-3.04/ && ./configure && make && make install WORKDIR /usr/src/app -RUN pip install --no-cache-dir -r requirements.txt \ No newline at end of file +COPY ./requirements.txt /requirements.txt +RUN pip install --no-cache-dir -r /requirements.txt \ No newline at end of file diff --git a/ciprs_reader/parser/section/header.py b/ciprs_reader/parser/section/header.py index 74118f2..b4af355 100644 --- a/ciprs_reader/parser/section/header.py +++ b/ciprs_reader/parser/section/header.py @@ -13,7 +13,7 @@ class CaseDetails(HeaderParser): """Extract County and File No from header on top of first page""" pattern = ( - r"\s*Case (Details|Summary) for Court Case[\s:]+(?P(\w\s*.*)+) (?P\w+)" + r"\s*Case (Details|Summary) for Court Case[\s:]+(?P.+) (?P\w+)" ) def extract(self, matches, report): diff --git a/ciprs_reader/reader/util.py b/ciprs_reader/reader/util.py index 8aebf0e..b768242 100644 --- a/ciprs_reader/reader/util.py +++ b/ciprs_reader/reader/util.py @@ -33,8 +33,8 @@ def json_default(obj): """Helper function to JSON serialize objects when using dumps().""" try: return obj.__json__() - except AttributeError: - raise TypeError("{} can not be JSON encoded".format(type(obj))) + except AttributeError as invaild_object_type: + raise TypeError("{} can not be JSON encoded".format(type(obj))) from invaild_object_type class LineReader: