From 87934a3260852142f75e7d601a11771301ab9daf Mon Sep 17 00:00:00 2001 From: Antonio de la Rosa Date: Mon, 17 Feb 2020 18:40:44 +0100 Subject: [PATCH] Fixes --- paramecio/citoplasma/mtemplates.py | 26 -------------------------- paramecio/citoplasma/urls.py | 9 +++++++++ paramecio/cromosoma/webmodel.py | 1 - paramecio/index.py | 9 ++++++--- 4 files changed, 15 insertions(+), 30 deletions(-) diff --git a/paramecio/citoplasma/mtemplates.py b/paramecio/citoplasma/mtemplates.py index 80ea371..8327d20 100644 --- a/paramecio/citoplasma/mtemplates.py +++ b/paramecio/citoplasma/mtemplates.py @@ -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:] diff --git a/paramecio/citoplasma/urls.py b/paramecio/citoplasma/urls.py index f161c2a..33af025 100644 --- a/paramecio/citoplasma/urls.py +++ b/paramecio/citoplasma/urls.py @@ -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): diff --git a/paramecio/cromosoma/webmodel.py b/paramecio/cromosoma/webmodel.py index b062471..bc88fef 100644 --- a/paramecio/cromosoma/webmodel.py +++ b/paramecio/cromosoma/webmodel.py @@ -143,7 +143,6 @@ class PhangoField: if value=="": self.txt_error=self.error_default self.error=True - return value diff --git a/paramecio/index.py b/paramecio/index.py index a5b4b84..7c78617 100644 --- a/paramecio/index.py +++ b/paramecio/index.py @@ -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()