-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
132 lines (86 loc) · 3.28 KB
/
config.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# [Project AutoKupis2] Auto-sugang project GUI.
# 0.1.0va, 19.12.29. First launched.
# written by acoustikue(SukJoon Oh)
# __ _ __
# ____ __________ __ _______/ /_(_) /____ _____
# / __ `/ ___/ __ \/ / / / ___/ __/ / //_/ / / / _ \
# / /_/ / /__/ /_/ / /_/ (__ ) /_/ / ,< / /_/ / __/
# \__,_/\___/\____/\__,_/____/\__/_/_/|_|\__,_/\___/
#
# Visual Studio Code
#
import os, sys
import platform
# import copy
# for import from parent directory
sys.path.append(
os.path.dirname(
os.path.abspath(os.path.dirname(__file__))) )
# Here the module's base directory will be set to folder where it is located.
# Every config files and other saved files must be in folder below the base directory.
PROJECT_CODE = 'auto_kupis_2'
PROJECT_OS = 'Windows'
PROJECT_SYS = ''
PROJECT_VERSION = '0.1.0va'
CURRENT_CODE = 'auto_kupis_2_w'
CURRENT_OS = str(platform.system())
CURRENT_SYS = CURRENT_OS + ' ' + str(platform.release()) + ' ' + str(platform.version())
# BASE_DIR = os.path.dirname(os.path.abspath(__file__))
if getattr(sys, 'frozen', False):
BASE_DIR = os.path.dirname(sys.executable)
elif __file__:
BASE_DIR = os.path.dirname(__file__)
# config_path = os.path.join(application_path, config_name)
WEBDRIVER_DIR = ''
# WEBDRIVER_DIR_R
LOG_DIR = ''
WEBDRIVER_DIR = BASE_DIR + '\\webdriver\\'
LOG_DIR = BASE_DIR + '\\log\\'
FIREFOX_WEBDRIVER = WEBDRIVER_DIR + 'geckodriver.exe'
FIREFOX_WEBDRIVER2 = BASE_DIR + 'geckodriver.exe'
# First!!
# Make directory if there is no db folder
if not(os.path.isdir(LOG_DIR)): os.makedirs(os.path.join(LOG_DIR))
PROJECT_BANNER = '[auto_kupis_2] ' + PROJECT_CODE + ', ' + PROJECT_VERSION
PROJECT_BANNER += (', ' + CURRENT_SYS + '\n\tCopyright (C) 2019 SukJoon Oh')
# Scripts
# platform
# Make sure to print just necessary information, for simple logs.
# URL info
KUPIS_SERVER_URL = 'https://kupis.konkuk.ac.kr/sugang/'
# Sugang login page, first step
KUPIS_LOGIN_URL = 'https://kupis.konkuk.ac.kr/sugang/login/loginTop.jsp'
# Controller
KUPIS_LOGIN_REQ_URL = 'https://kupis.konkuk.ac.kr/sugang/login/loginBtm.jsp'
# without iframe
KUPIS_SUGANG_URL = 'https://kupis.konkuk.ac.kr/sugang/acd/cour/aply/courLessinApplyReg.jsp'
KUPIS_SUGANG_REQ_URL = KUPIS_SUGANG_URL
# PyQt Configuration
#
QT_UI_DIR = BASE_DIR + '\\ui\\'
QT_UI_MAIN = QT_UI_DIR + 'auto_kupis_main.ui'
QT_UI_LIST = QT_UI_DIR + 'auto_kupis_list.ui'
QT_UI_ICON = QT_UI_DIR + 'auto_kupis_2.ico'
#
# Parameter: -
# Returns: -
# Author: acoustikue
def showConfig():
#if KENS_ENABLE is True:
# print('\tKENS_ENABLE(1). KENS module will be loaded.')
print('Script config:')
print('\tPROJECT_CODE \t' + PROJECT_CODE)
print('\tPROJECT_OS \t' + PROJECT_OS)
print('\tPROJECT_SYS \t' + PROJECT_SYS)
print('\tPROJECT_VERSION \t' + PROJECT_VERSION)
print('\tCURRENT_CODE \t' + CURRENT_CODE)
print('\tCURRENT_OS \t' + CURRENT_OS)
print('\tCURRENT_SYS \t' + CURRENT_SYS)
print('\tBASE_DIR \t' + BASE_DIR)
# Executing this script?
if __name__ == '__main__':
# First print banner
print(PROJECT_BANNER)
print('\tExecuting KnsfConfig script. Running in debug mode.\n')
# Show configuration variables
showConfig()