bug fix: plugins of main site don't work when run from another location

master
Steve Nyemba 10 months ago
parent e3d0632237
commit e3c49a7702

@ -34,7 +34,8 @@ class Loader :
""" """
f = open (self._path) f = open (self._path)
self._config = json.loads(f.read()) self._config = json.loads(f.read())
if self._caller : if self._caller :
self._location = self._original_location.split(os.sep) # needed for plugin loading self._location = self._original_location.split(os.sep) # needed for plugin loading
self._location = os.sep.join(self._location[:-1]) self._location = os.sep.join(self._location[:-1])
@ -62,7 +63,6 @@ class Loader :
if 'source' in _config['system'] and _config['system']['source']['id'] == 'cloud' : if 'source' in _config['system'] and _config['system']['source']['id'] == 'cloud' :
_sourceHandler = cloud _sourceHandler = cloud
else: else:
print ([' **** '])
_sourceHandler = disk _sourceHandler = disk
_object = _sourceHandler.build(_config) _object = _sourceHandler.build(_config)
@ -152,6 +152,10 @@ class Loader :
""" """
_config = self._config _config = self._config
PATH= os.sep.join([_config['layout']['root'],'_plugins']) PATH= os.sep.join([_config['layout']['root'],'_plugins'])
if not os.path.exists(PATH) :
#
# we need to determin if there's an existing
PATH = os.sep.join(self._path.split(os.sep)[:-1]+ [PATH] )
if not os.path.exists(PATH) and self._location and os.path.exists(self._location) : if not os.path.exists(PATH) and self._location and os.path.exists(self._location) :
# #
# overriding the location of plugins ... # overriding the location of plugins ...

Loading…
Cancel
Save