From 5177d94776106e4f9b6c83189b3acec906799ff8 Mon Sep 17 00:00:00 2001 From: squandor Date: Sat, 21 Jan 2017 23:03:00 +0100 Subject: [PATCH] added newline feature plugin readme --- modules/plugins.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/modules/plugins.py b/modules/plugins.py index 3107eb6..9834cb2 100644 --- a/modules/plugins.py +++ b/modules/plugins.py @@ -3,6 +3,7 @@ import git, shutil, os, imp import security +import re indexes = {} @@ -28,11 +29,11 @@ def setPluginDict(d): indexes = d def getPluginVersion(loc): - f = open(loc, 'r').read().split('\n') + f = open(loc, 'r').read().split('@') v = None for l in f: t = l.split('=') - if t[0] == '@version': + if t[0].lower() == 'version': _tmp_v = t[1].split('.') c = 1 _version = _tmp_v[0] + '.' @@ -81,12 +82,17 @@ def indexPlugins(params={}): else: fol['update'] = 'no' fol['status'] = 'remove' - readme = open(indexFolderPath + i + '/' + docsFolderPath + 'readme.md', 'r').read().split('\n') + readme = re.split('@', open(indexFolderPath + i + '/' + docsFolderPath + 'readme.md', 'r').read())#.split('@') + sumList = {} for s in readme: - t = s.split('=') - if len(t) > 1: - fol[t[0].replace('@', '')] = t[1] + if re.search('\w+=', str(s)): + _check = re.search('\w+=', str(s)).group().replace('=', '') + _text = re.sub('\w+=', '', s) + if _check == 'summary' or _check == 'description': + _text = re.sub('\n', '
', _text) + fol[_check] = _text + if not i in (f['folder'] for f in indexes.itervalues()): indexes[len(indexes)] = fol else: