-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp_paths.py
71 lines (54 loc) · 2.15 KB
/
app_paths.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
import os
import platform
import sys
from plist_set import ProcessSettingsClass
class DefinePathsClass:
@staticmethod
def create_resource_path(fn):
# application_path = sys._MEIPASS
application_path = os.path.dirname(sys.argv[0])
path_icon = os.path.join(application_path, "line-icons", fn)
return path_icon
@staticmethod
def create_reference_paths(fn):
# application_path = sys._MEIPASS
application_path = os.path.dirname(sys.argv[0])
subpath = ""
path_icon = os.path.join(application_path, subpath, "reference", fn)
return path_icon
@staticmethod
def create_configuration_paths(fn):
# application_path = sys._MEIPASS
application_path = os.path.dirname(sys.argv[0])
subpath = ""
path_icon = os.path.join(application_path, subpath, "configuration", fn)
return path_icon
@staticmethod
def get_icc_folder_path():
params = ProcessSettingsClass()
if params.setting_contains("iccFolder") and params.setting_restore("iccFolder") != "":
icc_folder = str(params.setting_restore("iccFolder"))
if not os.path.isdir(icc_folder):
icc_folder = None
else:
icc_folder = None
ps = platform.system()
if ps == "Windows":
# self.PATH = os.path.expanduser('~user')
if icc_folder is None:
icc_folder = "C:\Windows\System32\spool\drivers\color"
if not os.path.isdir(icc_folder):
icc_folder = None
else:
params.save_setting("iccFolder", icc_folder)
elif ps == "Darwin":
path = os.path.expanduser('~')
if icc_folder is None:
icc_folder = os.path.join(path, "Library/ColorSync/Profiles/")
if not os.path.isdir(icc_folder):
icc_folder = "/Library/ColorSync/Profiles/"
if not os.path.isdir(icc_folder):
icc_folder = None
else:
params.save_setting("iccFolder", icc_folder)
return icc_folder