markup: move WORKDIR to utils.py
This commit is contained in:
@ -9,11 +9,7 @@ import dumper
|
||||
import random as rng
|
||||
from pathlib import Path
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
from .utils import cv2_rect, set_file_perms
|
||||
|
||||
WORKDIR = os.path.join(settings.ASSET_DIR, 'markup', 'work')
|
||||
from .utils import cv2_rect, ensure_dir, set_file_perms, WORKDIR
|
||||
|
||||
# https://www.pyimagesearch.com/2014/10/20/finding-shapes-images-using-python-opencv/
|
||||
|
||||
|
||||
@ -7,11 +7,7 @@ from pdfminer.pdfparser import PDFParser
|
||||
from pdfminer.pdfdocument import PDFDocument
|
||||
from pdfminer.pdftypes import PDFObjRef, resolve1
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
from .utils import pdf_rect, ensure_dir, set_file_perms
|
||||
|
||||
WORKDIR = os.path.join(settings.ASSET_DIR, 'markup', 'work')
|
||||
from .utils import pdf_rect, ensure_dir, set_file_perms, WORKDIR
|
||||
|
||||
|
||||
def make_product_box(obj, pagenum, mediabox):
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
import os
|
||||
import shutil
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
WORKDIR = os.path.join(settings.ASSET_DIR, 'markup', 'work')
|
||||
|
||||
|
||||
def pdf_rect(rect, container_height):
|
||||
x1 = min(rect[0], rect[2])
|
||||
|
||||
Reference in New Issue
Block a user