Improve plugin error handling

This commit is contained in:
Arinerron 2018-04-21 17:37:20 -07:00
parent 9cf07355ce
commit c0e08eae79
No known key found for this signature in database
GPG key ID: 99383627861C62F0
2 changed files with 7 additions and 1 deletions

View file

@ -101,13 +101,16 @@ class Onionr:
os.mkdir('data/blocks/')
# Copy default plugins into plugins folder
if not os.path.exists('data/plugins/'):
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/')
# Enable plugins
for name in names:
plugins.enable(name, self)
if not name in plugins.get_enabled_plugins():
plugins.enable(name, self)
if not os.path.exists(self.onionrCore.peerDB):
self.onionrCore.createPeerDB()