Set internal and found plugin module_name separately.

Settled on `plugins.<internal` and `<plugins>.found` as the format.
This commit is contained in:
Athanasius committed 2020-07-31 14:46:38 +01:00
1 parent ad021e0765
commit 89f2726e48
1 file changed
+5
+5
View File
@@ -208,10 +208,15 @@ class EDMCContextFilter(logging.Filter):
# Is this a 'found' plugin calling us?
file_name = pathlib.Path(frame_info.filename).expanduser()
plugin_dir = pathlib.Path(config.plugin_dir).expanduser()
internal_plugin_dir = pathlib.Path(config.internal_plugin_dir).expanduser()
if file_name.parent.parent == plugin_dir:
# Pre-pend 'plugins.<plugin folder>.' to module
module_name = f'<plugins>.{file_name.parent.name}.{module_name}'
elif file_name.parent == internal_plugin_dir:
module_name = f'plugins.{module_name}'
# https://docs.python.org/3.7/library/inspect.html#the-interpreter-stack
del frame