-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.py
29 lines (25 loc) · 860 Bytes
/
init.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
import os
"""CMSimfly Initialization setup
"""
# get current directory, on Windows, back slash at the end of the directory
_curdir = os.path.join(os.getcwd(), os.path.dirname(__file__))
# config directory
config_dir = _curdir + "/config/"
class Init(object):
# uwsgi as static class variable, can be accessed by Init.uwsgi
uwsgi = False
site_title = "40823208 cd2021"
ip = "127.0.0.1"
port = 9443
def __init__(self):
# hope to create downloads and images directories
if not os.path.isdir(_curdir + "/downloads"):
try:
os.makedirs(_curdir + "/downloads")
except:
print("mkdir error")
if not os.path.isdir(_curdir + "/images"):
try:
os.makedirs(_curdir + "/images")
except:
print("mkdir error")