-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsettings.py
More file actions
30 lines (25 loc) · 795 Bytes
/
settings.py
File metadata and controls
30 lines (25 loc) · 795 Bytes
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
import os
import sys
is_frozen = getattr(sys, 'frozen', False)
if is_frozen:
root_dir = os.path.dirname(sys.executable)
else:
root_dir = os.path.dirname(os.path.realpath(__file__))
sessions_dir = os.path.join(root_dir, 'sessions')
static_dir = os.path.join(root_dir, 'static')
def _get_jdkpath(path_file):
try:
with open(path_file) as f:
for line in f:
line = line.strip()
if line.startswith('#'):
continue
if len(line) > 0:
if os.path.isabs(line):
return line
else:
return os.path.join(root_dir, line)
except:
pass
return ''
jdk_path = _get_jdkpath(os.path.join(root_dir, 'jdk.path'))