This commit is contained in:
Antonio de la Rosa 2020-02-17 18:40:44 +01:00
parent dc7e5689b7
commit 87934a3260
4 changed files with 15 additions and 30 deletions

View file

@ -15,32 +15,6 @@ from collections import OrderedDict
# Preparing envs for views of modules, and views of
""" A simple function for load views from themes using jinja2
Env use loader = FileSystemLoader(['/path/to/templates', '/other/path'])
env = Environment(loader=FileSystemLoader(['/path/to/templates', '/other/path']))
template = env.get_template('mytemplate.html')
"""
#@hook('after_request')
#def clean_tpl_cache():
#ptemplate.clean_header_cache()
#pass
"""
class Environment:
def __init__(self, module, cache_enabled=True, cache_impl='', cache_args={}):
self.cache_enable=cache_enabled
self.cache_impl=cache_impl
self.cache_args=cache_args
self.module_directory="./tmp/modules"
"""
def env_theme(module, cache_enabled=True, cache_impl='', cache_args={}, module_directory="./tmp/modules"):
ext=module[len(module)-3:]

View file

@ -41,6 +41,15 @@ def make_url(path, query_args={}):
def make_url_domain(path, query_args={}):
"""
This is a method for create an url with the real domain of site how prefix
Keyword arguments:
path -- The path of the module
query_args -- a ser of get variables for add to url
"""
return config.domain_url+make_url(path, query_args)
def add_get_parameters(url, **args):

View file

@ -143,7 +143,6 @@ class PhangoField:
if value=="":
self.txt_error=self.error_default
self.error=True
return value

View file

@ -64,15 +64,18 @@ def prepare_app():
arr_module_path[base_module]=controller_base
#app.add_hook('before_request', print_memory)
"""
for added_app in config.apps:
a=import_module(added_app)
#print(added_app, file=sys.stdout)
app_name=getattr(a, config.apps[added_app][0])
app.mount(config.apps[added_app][1], app_name)
#print(added_app)
#print(a.__path__[0])
"""
set_timezone()