1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 01:22:19 +03:00

Set internal and found plugin module_name separately.

Settled on `plugins.<internal` and `<plugins>.found` as the format.
This commit is contained in:
Athanasius 2020-07-30 18:04:03 +01:00
parent ad021e0765
commit 89f2726e48

@ -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