Fix current logging

This commit is contained in:
Vinayak Mehta
2018-09-07 05:53:19 +05:30
parent 09ac8f4640
commit 20acda2259
3 changed files with 39 additions and 41 deletions
+3 -4
View File
@@ -2,7 +2,6 @@ from __future__ import division
import os
import copy
import logging
import warnings
import subprocess
import numpy as np
@@ -12,12 +11,12 @@ from .base import BaseParser
from ..core import Table
from ..utils import (scale_image, scale_pdf, segments_in_bbox, text_in_bbox,
merge_close_values, get_table_index, compute_accuracy,
count_empty, encode_)
count_empty, encode_, setup_logging)
from ..image_processing import (adaptive_threshold, find_lines,
find_table_contours, find_table_joints)
logger = logging.getLogger('camelot')
logger = setup_logging(__name__)
class Lattice(BaseParser):
@@ -218,7 +217,7 @@ class Lattice(BaseParser):
self._generate_layout(filename)
if not self.horizontal_text:
warnings.warn("No tables found on {}".format(
logger.info("No tables found on {}".format(
os.path.basename(self.rootname)))
return [], self.g
+3 -5
View File
@@ -1,7 +1,6 @@
from __future__ import division
import os
import logging
import warnings
import numpy as np
import pandas as pd
@@ -12,7 +11,7 @@ from ..utils import (text_in_bbox, get_table_index, compute_accuracy,
count_empty, encode_)
logger = logging.getLogger('camelot')
logger = setup_logging(__name__)
class Stream(BaseParser):
@@ -167,8 +166,7 @@ class Stream(BaseParser):
else:
ncols = max(set(elements), key=elements.count)
if ncols == 1:
# no tables condition
warnings.warn("No tables found on {}".format(
logger.info("No tables found on {}".format(
os.path.basename(self.rootname)))
cols = [(t.x0, t.x1)
for r in rows_grouped if len(r) == ncols for t in r]
@@ -232,7 +230,7 @@ class Stream(BaseParser):
self._generate_layout(filename)
if not self.horizontal_text:
warnings.warn("No tables found on {}".format(
logger.info("No tables found on {}".format(
os.path.basename(self.rootname)))
return [], self.g