Add f-strings and remove python3.5 test job

This commit is contained in:
Vinayak Mehta
2020-05-24 18:14:43 +05:30
parent afa1ba7c1f
commit 52b2a595b4
10 changed files with 47 additions and 56 deletions
+7 -7
View File
@@ -357,7 +357,7 @@ class Stream(BaseParser):
ncols = max(set(elements), key=elements.count)
else:
warnings.warn(
"No tables found in table area {}".format(table_idx + 1)
f"No tables found in table area {table_idx + 1}"
)
cols = [(t.x0, t.x1) for r in rows_grouped if len(r) == ncols for t in r]
cols = self._merge_columns(sorted(cols), column_tol=self.column_tol)
@@ -432,19 +432,19 @@ class Stream(BaseParser):
def extract_tables(self, filename, suppress_stdout=False, layout_kwargs={}):
self._generate_layout(filename, layout_kwargs)
base_filename = os.path.basename(self.rootname)
if not suppress_stdout:
logger.info("Processing {}".format(os.path.basename(self.rootname)))
logger.info(f"Processing {base_filename}")
if not self.horizontal_text:
if self.images:
warnings.warn(
"{} is image-based, camelot only works on"
" text-based pages.".format(os.path.basename(self.rootname))
f"{base_filename} is image-based, camelot only works on"
" text-based pages.")
)
else:
warnings.warn(
"No tables found on {}".format(os.path.basename(self.rootname))
)
warnings.warn(f"No tables found on {base_filename}"))
return []
self._generate_table_bbox()