Fix small bug with description and authors

master
Arinerron 2018-05-13 21:19:33 -07:00
parent b1e9e61430
commit 15d0e7c6fd
No known key found for this signature in database
GPG Key ID: 99383627861C62F0
2 changed files with 4 additions and 3 deletions

View File

@ -25,7 +25,7 @@ import sys
if sys.version_info[0] == 2 or sys.version_info[1] < 5: if sys.version_info[0] == 2 or sys.version_info[1] < 5:
print('Error, Onionr requires Python 3.4+') print('Error, Onionr requires Python 3.4+')
sys.exit(1) 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 from threading import Thread
import api, core, config, logger, onionrplugins as plugins, onionrevents as events import api, core, config, logger, onionrplugins as plugins, onionrevents as events
import onionrutils import onionrutils

View File

@ -181,6 +181,7 @@ def pluginToBlock(plugin, import_block = True):
data = base64.b64encode(open(zipfile, 'rb').read()) data = base64.b64encode(open(zipfile, 'rb').read())
author = getpass.getuser() author = getpass.getuser()
description = 'Default plugin description'
info = {"name" : plugin} info = {"name" : plugin}
try: try:
if os.path.exists(directory + 'info.json'): if os.path.exists(directory + 'info.json'):
@ -188,11 +189,11 @@ def pluginToBlock(plugin, import_block = True):
if 'author' in info: if 'author' in info:
author = info['author'] author = info['author']
if 'description' in info: if 'description' in info:
author = info['description'] description = info['description']
except: except:
pass 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) hash = pluginapi.get_core().insertBlock(json.dumps(metadata), header = 'plugin', sign = True)