From 3b7d086a2d591b3447f7eef4a99c6b22e819396e Mon Sep 17 00:00:00 2001
From: Manish
Date: Fri, 1 May 2020 16:12:08 +1000
Subject: [PATCH] Bundles are now stored with version number so that new
releases do not overwrite previous version bundles
---
generator/main.py | 20 +++++++++++++++-----
website/js/search.js | 2 +-
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/generator/main.py b/generator/main.py
index 03f6de0..44975f3 100644
--- a/generator/main.py
+++ b/generator/main.py
@@ -86,6 +86,9 @@ class extractData:
# FIXME: create separate function for it
# extract and copy icon
activityName = infoDict.get("name")
+ activityVersion = infoDict.get("activity_version")
+ if activityVersion is None:
+ activityVersion = ''
if type(activityName) == str:
iconRelativePath = infoDict.get("icon")
if type(iconRelativePath) == str:
@@ -105,7 +108,8 @@ class extractData:
self.iconErrorBundles.append(bundlePath)
bundle.close()
- self.copyBundle(bundlePath, activityName)
+ self.copyBundle(
+ bundlePath, activityName+'v'+activityVersion)
bundle.close()
def findBundles(self):
@@ -118,14 +122,15 @@ class extractData:
iconsDir = "../icons/"
bundlesDir = "../bundles/"
for appInfo in self.indexDictList:
- pathName = strToHtmlFmt(appInfo["name"], safe='')
+ appName = strToHtmlFmt(appInfo["name"], safe='')
+ appVersion = strToHtmlFmt(appInfo["version"], safe='')
html = (
'\n\n\n' + appInfo["name"] +
'\n\n\n\n\n'
'\n' + appInfo["name"] + '
\n\n'
+ str(iconsDir + appName + '.svg') + '">
\n'
'Summary
\n
' + appInfo["summary"] +
'
\n
\nDescription
\n
' +
appInfo["description"] + '
\n
\nTags'
@@ -135,7 +140,7 @@ class extractData:
html += '
' + tag + '\n'
html += (
'\n\n\n
\n\n