Start working on plugin manager
This commit is contained in:
parent
0ce3c7d940
commit
654703d902
5 changed files with 146 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue