From 1fea2e5f39a70e7df33ad3af53de7ba23b3d4024 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Thu, 20 Oct 2022 18:41:37 -0500 Subject: [PATCH] bug fix: environment context throws an error on null --- cms/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cms/__init__.py b/cms/__init__.py index 41450bb..e1df8c6 100644 --- a/cms/__init__.py +++ b/cms/__init__.py @@ -45,16 +45,19 @@ class components : _submenu[_index] = _item _index += 1 return _object - def html(uri,id,_args=None) : + def html(uri,id,_args={}) : """ This function reads a given uri and returns the appropriate html document, and applies environment context """ _html = (open(uri)).read() + + #return ' '.join(['
'.replace(':id',id),_html,'
']) _html = ' '.join(['
'.replace(':id',id),_html,'
']) appContext = Environment(loader=BaseLoader()).from_string(_html) return appContext.render(**_args) + # return _html def data (_args): """ :store data-store parameters (data-transport, github.com/lnyemba/data-transport)