61
61
PHATCH_FONTS_CACHE_PATH= config_paths['PHATCH_FONTS_CACHE_PATH']
62
62
return config_paths
63
63
SYSTEM_INSTALL = True
64
PHATCH_SHARE_PATH = os.path.join(sys.prefix, "share")#also for win?
65
PHATCH_FONTS_PATH = os.path.join(PHATCH_SHARE_PATH,
64
ROOT_SHARE_PATH = os.path.join(sys.prefix, "share")#for win?
65
PHATCH_SHARE_PATH = os.path.join(ROOT_SHARE_PATH,"phatch")
66
PHATCH_DATA_PATH = os.path.join(PHATCH_SHARE_PATH,"data")
67
PHATCH_FONTS_PATH = os.path.join(PHATCH_DATA_PATH,"fonts")
67
68
PHATCH_FONTS_CACHE_PATH = os.path.join(PHATCH_SHARE_PATH,
68
"phatch","cache","fonts")
70
71
if sys.platform.startswith('win'):
78
"PHATCH_IMAGE_PATH" : os.path.join(PHATCH_SHARE_PATH,
80
"PHATCH_LOCALE_PATH": os.path.join(PHATCH_SHARE_PATH,
82
"PHATCH_DOCS_PATH" : os.path.join(PHATCH_SHARE_PATH,
84
"PHATCH_FONTS_PATH" : PHATCH_FONTS_PATH,
85
"PHATCH_FONTS_CACHE_PATH" : PHATCH_FONTS_CACHE_PATH,
86
"PHATCH_ACTIONLISTS_PATH": os.path.join(PHATCH_SHARE_PATH,
87
"phatch","actionlists"),
79
'PHATCH_IMAGE_PATH' : os.path.join(PHATCH_SHARE_PATH,
81
'PHATCH_LOCALE_PATH': os.path.join(PHATCH_SHARE_PATH,
83
'PHATCH_DOCS_PATH' : os.path.join(PHATCH_SHARE_PATH,
86
'PHATCH_FONTS_CACHE_PATH' : PHATCH_FONTS_CACHE_PATH,
88
'PHATCH_ACTIONLISTS_PATH': os.path.join(PHATCH_DATA_PATH,
90
'PHATCH_FONTS_PATH' : PHATCH_FONTS_PATH,
91
'PHATCH_HIGHLIGHTS_PATH' : os.path.join(PHATCH_DATA_PATH,
93
'PHATCH_MASKS_PATH' : os.path.join(PHATCH_DATA_PATH,
90
97
def add_user_paths(config_paths):
91
98
config_paths.update({
92
"USER_PATH" : USER_PATH,
93
"USER_ACTIONS_PATH" : USER_ACTIONS_PATH,
94
"USER_BIN_PATH" : USER_BIN_PATH,
95
"USER_FONTS_PATH" : USER_FONTS_PATH,
96
"USER_FONTS_CACHE_PATH" : USER_FONTS_CACHE_PATH,
97
"USER_MASKS_PATH" : USER_MASKS_PATH,
98
"USER_HIGHLIGHTS_PATH" : USER_HIGHLIGHTS_PATH,
99
"USER_PREVIEW_PATH" : USER_PREVIEW_PATH,
100
"USER_SETTINGS_PATH" : USER_SETTINGS_PATH,
101
"USER_WATERMARKS_PATH" : USER_WATERMARKS_PATH,
99
'USER_PATH' : USER_PATH,
100
'USER_ACTIONS_PATH' : USER_ACTIONS_PATH,
101
'USER_BIN_PATH' : USER_BIN_PATH,
102
'USER_FONTS_PATH' : USER_FONTS_PATH,
103
'USER_FONTS_CACHE_PATH' : USER_FONTS_CACHE_PATH,
104
'USER_MASKS_PATH' : USER_MASKS_PATH,
105
'USER_HIGHLIGHTS_PATH' : USER_HIGHLIGHTS_PATH,
106
'USER_PREVIEW_PATH' : USER_PREVIEW_PATH,
107
'USER_SETTINGS_PATH' : USER_SETTINGS_PATH,
108
'USER_WATERMARKS_PATH' : USER_WATERMARKS_PATH,
104
111
def fix_python_path(phatch_python_path=None):
136
143
add_user_paths(config_paths)
137
144
#configure sys.path
138
145
phatch_path = fix_python_path(
139
config_paths.get("PHATCH_PYTHON_PATH",None))
146
config_paths.get('PHATCH_PYTHON_PATH',None))
140
147
fix_python_path(os.path.join(phatch_path,'core','lib'))
141
148
#only when the gui is involved
142
149
pyWxLib = os.path.join(phatch_path,'pyWx','lib')
154
161
fix_python_path(USER_ACTIONS_PATH)
156
#load_locale('phatch',config_paths["PHATCH_LOCALE_PATH"])
163
#load_locale('phatch',config_paths['PHATCH_LOCALE_PATH'])
158
165
from fonts import set_font_cache
159
166
set_font_cache(USER_FONTS_PATH, PHATCH_FONTS_PATH,