From 15d0e7c6fd90d94d6190423fa2fd498747ecd939 Mon Sep 17 00:00:00 2001 From: Arinerron Date: Sun, 13 May 2018 21:19:33 -0700 Subject: [PATCH] Fix small bug with description and authors --- onionr/onionr.py | 2 +- onionr/static-data/default-plugins/pluginmanager/main.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/onionr/onionr.py b/onionr/onionr.py index 081f5a30..d55664a8 100755 --- a/onionr/onionr.py +++ b/onionr/onionr.py @@ -25,7 +25,7 @@ import sys if sys.version_info[0] == 2 or sys.version_info[1] < 5: print('Error, Onionr requires Python 3.4+') sys.exit(1) -import os, base64, random, getpass, shutil, subprocess, requests, time, platform, datetime, re, json +import os, base64, random, getpass, shutil, subprocess, requests, time, platform, datetime, re, json, getpass from threading import Thread import api, core, config, logger, onionrplugins as plugins, onionrevents as events import onionrutils diff --git a/onionr/static-data/default-plugins/pluginmanager/main.py b/onionr/static-data/default-plugins/pluginmanager/main.py index 7fc4ebf3..a3a454d6 100644 --- a/onionr/static-data/default-plugins/pluginmanager/main.py +++ b/onionr/static-data/default-plugins/pluginmanager/main.py @@ -181,6 +181,7 @@ def pluginToBlock(plugin, import_block = True): data = base64.b64encode(open(zipfile, 'rb').read()) author = getpass.getuser() + description = 'Default plugin description' info = {"name" : plugin} try: if os.path.exists(directory + 'info.json'): @@ -188,11 +189,11 @@ def pluginToBlock(plugin, import_block = True): if 'author' in info: author = info['author'] if 'description' in info: - author = info['description'] + description = info['description'] except: pass - metadata = {'author' : author, 'date' : str(datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')), 'name' : plugin, 'info' : info, 'compiled-by' : plugin_name, 'content' : data.decode('utf-8')} + metadata = {'author' : author, 'date' : str(datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')), 'name' : plugin, 'info' : info, 'compiled-by' : plugin_name, 'content' : data.decode('utf-8'), 'description' : description} hash = pluginapi.get_core().insertBlock(json.dumps(metadata), header = 'plugin', sign = True)