-
Notifications
You must be signed in to change notification settings - Fork 20
/
constants.py
33 lines (27 loc) · 984 Bytes
/
constants.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
import gettext
import locale
import os
import sys
from pathlib import Path
import psutil
BASE_DIR = Path(__file__).absolute().parent
PHYSICAL_CPU_COUNT = psutil.cpu_count(logical=False)
EXEC_NAME = 'PDFeXpress'
APP_NAME = 'PDF eXpress'
APP_VERSION = '0.3.4-BETA'
APP_URL = f'https://github.com/chianjin/{EXEC_NAME}'
APP_ICON = BASE_DIR / f'icon/{EXEC_NAME}32.png'
if 'win' in sys.platform:
os.environ['LANGUAGE'] = locale.getdefaultlocale()[0]
gettext.install(domain=APP_NAME.replace(' ', ''), localedir=str(BASE_DIR / 'locale'))
BYTE_UNIT = ('', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y')
FILE_TYPES_PDF = ((_('PDF File'), '*.pdf'),)
FILE_TYPES_TEXT = ((_('Text File'), '*.txt'),)
FILE_TYPES_IMAGE = (
(_('Image File'), '*.jpg;*.jpeg;*.png;*.gif;*.tif;*.tiff;*.bmp'),
(_('JPEG Image'), '*.jpg;*.jpeg'),
(_('PNG Image'), '*.png'),
(_('GIF Image'), '*.gif'),
(_('TIFF Image'), '*.tif;*.tiff'),
(_('BMP Image'), '*.bmp')
)