bug fix: environment context throws an error on null
This commit is contained in:
parent
7426705ffb
commit
1fea2e5f39
|
@ -45,16 +45,19 @@ class components :
|
||||||
_submenu[_index] = _item
|
_submenu[_index] = _item
|
||||||
_index += 1
|
_index += 1
|
||||||
return _object
|
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
|
This function reads a given uri and returns the appropriate html document, and applies environment context
|
||||||
|
|
||||||
"""
|
"""
|
||||||
_html = (open(uri)).read()
|
_html = (open(uri)).read()
|
||||||
|
|
||||||
|
|
||||||
#return ' '.join(['<div id=":id" class=":id">'.replace(':id',id),_html,'</div>'])
|
#return ' '.join(['<div id=":id" class=":id">'.replace(':id',id),_html,'</div>'])
|
||||||
_html = ' '.join(['<div id=":id" class=":id">'.replace(':id',id),_html,'</div>'])
|
_html = ' '.join(['<div id=":id" class=":id">'.replace(':id',id),_html,'</div>'])
|
||||||
appContext = Environment(loader=BaseLoader()).from_string(_html)
|
appContext = Environment(loader=BaseLoader()).from_string(_html)
|
||||||
return appContext.render(**_args)
|
return appContext.render(**_args)
|
||||||
|
# return _html
|
||||||
def data (_args):
|
def data (_args):
|
||||||
"""
|
"""
|
||||||
:store data-store parameters (data-transport, github.com/lnyemba/data-transport)
|
:store data-store parameters (data-transport, github.com/lnyemba/data-transport)
|
||||||
|
|
Loading…
Reference in New Issue