added logging statements
This commit is contained in:
@@ -487,7 +487,7 @@ async def get_submission(
|
||||
f"lva: {lva}, prof: {prof}, fname {fname}, stype: {stype}, subcat: {subcat}, sem: {sem}, ex_date: {ex_date}, rects: {rects}, pagescales: {pagescales}, ocr: {ocr}"
|
||||
)
|
||||
info(
|
||||
f"lva: {lva}, prof: {prof}, fname {fname}, stype: {stype}, subcat: {subcat}, sem: {sem}, ex_date: {ex_date}, rects: {rects}, pagescales: {pagescales}, ocr: {ocr}"
|
||||
f"Got Submission: lva: {lva}, prof: {prof}, fname {fname}, stype: {stype}, subcat: {subcat}, sem: {sem}, ex_date: {ex_date}, rects: {rects}, pagescales: {pagescales}, ocr: {ocr}"
|
||||
)
|
||||
rects_p = json.loads(rects)
|
||||
scales_p = json.loads(pagescales)
|
||||
@@ -592,6 +592,7 @@ def censor_pdf(
|
||||
Returns:
|
||||
None
|
||||
"""
|
||||
info(f"started Censoring for file {path} to be saved to {destpath}")
|
||||
doc = pymupdf.open(path)
|
||||
page = doc[0]
|
||||
npage = doc.page_count
|
||||
@@ -642,6 +643,7 @@ def censor_pdf_ocr(
|
||||
Returns:
|
||||
None
|
||||
"""
|
||||
info(f"started Censoring in OCR Mode for file {path} to be saved to {destpath}")
|
||||
doc = pymupdf.open(path)
|
||||
output = pymupdf.open()
|
||||
page = doc[0]
|
||||
@@ -738,7 +740,7 @@ def make_savepath(
|
||||
pf = get_profpath(prof, lv[0])
|
||||
pfpath = Path(pf[1])
|
||||
catpath = Path(CATEGORIES[int(cat)])
|
||||
scpath = ""
|
||||
scpath: str | os.PathLike = ""
|
||||
if int(cat) in SUBCAT_CATEGORIES_I and subcat != "":
|
||||
sc = get_subcatpath(subcat, int(cat), pf[0], lv[0])
|
||||
scpath = Path(sc[1])
|
||||
@@ -770,6 +772,7 @@ def make_savepath(
|
||||
i += 1
|
||||
destpath = savepath / file
|
||||
destpath.touch()
|
||||
info(f"Path for file to be saved generated as: {savepath / file}")
|
||||
return savepath / file
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user