Start working on plugin manager

This commit is contained in:
Arinerron 2018-04-22 20:42:37 -07:00
parent 0ce3c7d940
commit 654703d902
No known key found for this signature in database
GPG key ID: 99383627861C62F0
5 changed files with 146 additions and 14 deletions

View file

@ -102,16 +102,20 @@ class Onionr:
# Copy default plugins into plugins folder
if not os.path.exists('data/plugins/'):
if not os.path.exists(plugins.get_plugins_folder()):
if os.path.exists('default-plugins/'):
names = [f for f in os.listdir("default-plugins/") if not os.path.isfile(f)]
shutil.copytree('default-plugins/', 'data/plugins/')
shutil.copytree('default-plugins/', plugins.get_plugins_folder())
# Enable plugins
for name in names:
if not name in plugins.get_enabled_plugins():
plugins.enable(name, self)
for name in plugins.get_enabled_plugins():
if not os.path.exists(plugins.get_plugin_data_folder(name)):
os.mkdir(plugins.get_plugin_data_folder(name))
if not os.path.exists(self.onionrCore.peerDB):
self.onionrCore.createPeerDB()
pass