|
@@ -141,7 +141,9 @@ def site_preload(data_path, confdir_basename = 'conf.d', lodelsites_instance = F
|
141
|
141
|
LodelFatalError('Bad argument given to site_load(). This really \
|
142
|
142
|
sux !')
|
143
|
143
|
#Determining uniq sitename from data_path
|
144
|
|
- data_path = os.path.dirname(data_path).rstrip('/') #else basename returns ''
|
|
144
|
+ data_path = data_path.rstrip('/')
|
|
145
|
+ if lodelsites_instance:
|
|
146
|
+ data_path = os.path.dirname(data_path).rstrip('/')
|
145
|
147
|
ctx_name = os.path.basename(data_path)
|
146
|
148
|
if not os.path.exists(data_path) or not os.path.isdir(data_path):
|
147
|
149
|
LodelContext.expose_modules(globals(), {
|
|
@@ -150,7 +152,7 @@ sux !')
|
150
|
152
|
#Immediately switching to the context
|
151
|
153
|
LodelContext.new(ctx_name)
|
152
|
154
|
LodelContext.set(ctx_name)
|
153
|
|
- os.chdir(data_path) #Now the confdir is ./$condir_basename
|
|
155
|
+ confdir = os.path.join(data_path, confdir_basename)
|
154
|
156
|
#Loading settings for current site
|
155
|
157
|
LodelContext.expose_modules(globals(), {
|
156
|
158
|
'lodel.settings.settings': [('Settings', 'settings_preloader')]})
|
|
@@ -164,10 +166,10 @@ This should not append !' % ctx_name
|
164
|
166
|
if lodelsites_instance:
|
165
|
167
|
#fetching custom confspec
|
166
|
168
|
custom_confspec = _get_confspec("dummy_argument_is_obsolete")
|
167
|
|
- settings_preloader(os.path.join('./', confdir_basename),
|
|
169
|
+ settings_preloader(os.path.join('./', confdir),
|
168
|
170
|
custom_confspec, True)
|
169
|
171
|
else:
|
170
|
|
- settings_preloader(os.path.join('./', confdir_basename))
|
|
172
|
+ settings_preloader(os.path.join('./', confdir))
|
171
|
173
|
LodelContext.set(None)
|
172
|
174
|
return
|
173
|
175
|
|