Skip to content

Commit

Permalink
Get the correct location of the inbuilt plugins directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
hsorby committed May 3, 2021
1 parent a1fdc12 commit b0032b3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/mapclient/core/managers/pluginmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from pkgutil import extend_path
import pkg_resources

from mapclient.core.utils import which, FileTypeObject, grep
from mapclient.core.utils import which, FileTypeObject, grep, is_frozen
from mapclient.settings.definitions import VIRTUAL_ENV_PATH, \
PLUGINS_PACKAGE_NAME, PLUGINS_PTH
from mapclient.core.checks import getPipExecutable, getActivateScript
Expand Down Expand Up @@ -175,8 +175,11 @@ def setLoadDefaultPlugins(self, loadDefaultPlugins):
def allDirectories(self):
plugin_dirs = self._directories[:]
if self._load_default_plugins:
file_dir = os.path.dirname(os.path.abspath(__file__))
inbuilt_plugin_dir = os.path.realpath(os.path.join(file_dir, '..', '..', 'plugins'))
if is_frozen():
inbuilt_plugin_dir = os.path.join(sys._MEIPASS, PLUGINS_PACKAGE_NAME)
else:
file_dir = os.path.dirname(os.path.abspath(__file__))
inbuilt_plugin_dir = os.path.realpath(os.path.join(file_dir, '..', '..', PLUGINS_PACKAGE_NAME))
plugin_dirs.insert(0, inbuilt_plugin_dir)

return plugin_dirs
Expand Down

0 comments on commit b0032b3

Please sign in to comment.