From 862e7cb4f609354eb8c0eae63dcb6449b7cdb8ef Mon Sep 17 00:00:00 2001 From: Evildoor Date: Fri, 1 Dec 2017 11:31:27 +0300 Subject: [PATCH 1/2] Updated regular expression. This solves a problem described in Issues, link will be made. --- Utils/Dataflow/030_PDFAnalyzer/manager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Utils/Dataflow/030_PDFAnalyzer/manager.py b/Utils/Dataflow/030_PDFAnalyzer/manager.py index 217a49af3..509852bbb 100644 --- a/Utils/Dataflow/030_PDFAnalyzer/manager.py +++ b/Utils/Dataflow/030_PDFAnalyzer/manager.py @@ -256,7 +256,8 @@ def find(self, text, intervals, datasets): re_table_header = re.compile("Table \d+:.*?\n\n", re.DOTALL) re_table_header_short = re.compile("Table (\d+):") re_table_datasets = re.compile("(?:sample|dataset|run)") -re_column_with_datasets = re.compile("^(?:ds[-_ ]?|mc[-_ ]?|data ?|dataset ?" +re_column_with_datasets = re.compile("^(?:d[cs]?[-_ ]?|mc[-_ ]?|data ?" + "|dataset ?" "|period|request ?|run ?|sample ?)(?:id" "|number|period|range|sample|set)") re_dsid = re.compile("^\d{4,8}$") From 07f5696f6b22a8689ef4e4bad7b6e4413dc68265 Mon Sep 17 00:00:00 2001 From: Evildoor Date: Fri, 1 Dec 2017 11:37:27 +0300 Subject: [PATCH 2/2] Fixed an error with adding papers. Starting to add papers and pressing "Cancel" in the dialogue lead to "fnames" variable being not what the program expected. Check was added to prevent this. --- Utils/Dataflow/030_PDFAnalyzer/manager.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Utils/Dataflow/030_PDFAnalyzer/manager.py b/Utils/Dataflow/030_PDFAnalyzer/manager.py index 509852bbb..5746557e1 100644 --- a/Utils/Dataflow/030_PDFAnalyzer/manager.py +++ b/Utils/Dataflow/030_PDFAnalyzer/manager.py @@ -1083,6 +1083,8 @@ def add_papers(self, fnames=None, errors=None, n=None): if fnames is None: fnames = askopenfilenames(initialdir=cfg["WORK_DIR"], filetypes=[("PDF files", ".pdf")]) + if not fnames: + return False errors = {} n = 1 self.window.after(100, lambda: self.add_papers(fnames, errors, n))