Fixes
This commit is contained in:
parent
dc7e5689b7
commit
87934a3260
4 changed files with 15 additions and 30 deletions
|
|
@ -15,32 +15,6 @@ from collections import OrderedDict
|
||||||
|
|
||||||
# Preparing envs for views of modules, and views of
|
# 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"):
|
def env_theme(module, cache_enabled=True, cache_impl='', cache_args={}, module_directory="./tmp/modules"):
|
||||||
|
|
||||||
ext=module[len(module)-3:]
|
ext=module[len(module)-3:]
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,15 @@ def make_url(path, query_args={}):
|
||||||
|
|
||||||
def make_url_domain(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)
|
return config.domain_url+make_url(path, query_args)
|
||||||
|
|
||||||
def add_get_parameters(url, **args):
|
def add_get_parameters(url, **args):
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,6 @@ class PhangoField:
|
||||||
self.txt_error=self.error_default
|
self.txt_error=self.error_default
|
||||||
self.error=True
|
self.error=True
|
||||||
|
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
def set_relationships(self):
|
def set_relationships(self):
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ def prepare_app():
|
||||||
arr_module_path[base_module]=controller_base
|
arr_module_path[base_module]=controller_base
|
||||||
|
|
||||||
#app.add_hook('before_request', print_memory)
|
#app.add_hook('before_request', print_memory)
|
||||||
|
"""
|
||||||
for added_app in config.apps:
|
for added_app in config.apps:
|
||||||
|
|
||||||
a=import_module(added_app)
|
a=import_module(added_app)
|
||||||
|
|
@ -72,7 +72,10 @@ def prepare_app():
|
||||||
app_name=getattr(a, config.apps[added_app][0])
|
app_name=getattr(a, config.apps[added_app][0])
|
||||||
|
|
||||||
app.mount(config.apps[added_app][1], app_name)
|
app.mount(config.apps[added_app][1], app_name)
|
||||||
|
#print(added_app)
|
||||||
|
#print(a.__path__[0])
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
set_timezone()
|
set_timezone()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue