From 3bbb6cf053c97c2f186015c2956cbc0dfb3cc416 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 1 Dec 2019 16:18:33 +0100 Subject: [PATCH] Include dev version of vue.js if available in the HTTP static/js folder, otherwise include the minified version --- platypush/backend/http/templates/index.html | 4 ++++ platypush/backend/http/utils.py | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/platypush/backend/http/templates/index.html b/platypush/backend/http/templates/index.html index cd13a4c0..f8f2f926 100644 --- a/platypush/backend/http/templates/index.html +++ b/platypush/backend/http/templates/index.html @@ -32,8 +32,12 @@ {% endif %} + {% if utils.isfile(static_folder, 'js', 'lib', 'vue.js') %} + {% else %} + {% endif %} + diff --git a/platypush/backend/http/utils.py b/platypush/backend/http/utils.py index 71ed46ee..ccfaf3f4 100644 --- a/platypush/backend/http/utils.py +++ b/platypush/backend/http/utils.py @@ -109,7 +109,8 @@ class HttpUtils(object): return f.read() @classmethod - def isfile(cls, file): - return os.path.isfile(file) + def isfile(cls, *path): + path = path[0] if len(path) == 1 else os.path.join(*path) + return os.path.isfile(path) # vim:sw=4:ts=4:et: