1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-06-04 09:31:12 +03:00

Add plugins' folders to sys.path again.

Was broken by 084128e.
This commit is contained in:
Jonathan Harris 2017-08-02 09:05:31 +01:00
parent bd7ac05a11
commit d223770af8

View File

@ -115,13 +115,15 @@ def load_plugins():
found = [] found = []
for name in os.listdir(config.plugin_dir): for name in os.listdir(config.plugin_dir):
if name[0] == '.': if name[0] in ['.', '_']:
pass pass
elif name.endswith('.disabled'): elif name.endswith('.disabled'):
name, discard = name.rsplit('.', 1) name, discard = name.rsplit('.', 1)
found.append(Plugin(name, None)) found.append(Plugin(name, None))
else: else:
try: try:
# Add plugin's folder to Python's load path in case plugin has dependencies.
sys.path.append(os.path.join(config.plugin_dir, name))
found.append(Plugin(name, os.path.join(config.plugin_dir, name, 'load.py'))) found.append(Plugin(name, os.path.join(config.plugin_dir, name, 'load.py')))
except: except:
print_exc() print_exc()