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