-
Notifications
You must be signed in to change notification settings - Fork 0
/
constant.py
49 lines (40 loc) · 1.2 KB
/
constant.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Time : 2018/3/26 10:27
# Author: Wakesy
# Email : chenxi@szsandstone.com
import os
import sys
# 脚本的根目录
ROOT_DIR = os.path.abspath(os.path.dirname(__file__))
sys.path.append(ROOT_DIR)
# 系统的配置文件
COMMON_CONF = os.path.join(ROOT_DIR, "common.conf")
# 后处理的配置文件
BACK_PROC_CONF = os.path.join(ROOT_DIR, "back_process/back_process.conf")
# 本地下载目录
DOWNLOAD_DIR = os.path.abspath(os.path.join(ROOT_DIR, "download"))
# MQ连接url格式
MQ_URL_FORMAT = "amqp://{user}:{password}@{host}:{port}/{vhost}?socket_timeout={timeout}"
CONVERT_TO_PDF = 'convert_to_pdf' # word转pdf
# imghdr 库支持的图片文件类型
IMG_JPEG = 'jpeg'
IMG_GIF = 'gif'
IMG_PNG = 'png'
IMG_RGB = 'rgb'
IMG_PGM = 'pgm'
IMG_PBM = 'pbm'
IMG_PPM = 'ppm'
IMG_TIFF = 'tiff'
IMG_RAST = 'rast'
IMG_XBM = 'xbm'
IMG_BMP = 'bmp'
IMG_TYPES = [IMG_JPEG, IMG_GIF, IMG_PNG, IMG_RGB, IMG_PGM, IMG_PBM,
IMG_PPM, IMG_TIFF, IMG_RAST,IMG_XBM, IMG_BMP]
# 转换类型对应的文件后缀
CONVERT_POSTFIX = {
"convert_to_pdf" :"pdf",
"convert_to_jpeg": "jpeg",
"convert_to_bmp" : "bmp",
"convert_to_gif" : "gif"
}