Multiple fixes in paths, cleaning code...

This commit is contained in:
absurdo 2023-11-21 20:09:34 +01:00
parent dc58175760
commit 73f9a5589e
4 changed files with 12 additions and 18 deletions

View file

@ -70,9 +70,10 @@ def start_app():
a=import_module(module_app)
arr_module_path[key_app]=os.path.dirname(sys.modules[module_app].__file__)
if config.application_root=='/':
app.register_blueprint(app_name, url_prefix=added_app[2])
else:
app.register_blueprint(app_name, url_prefix=config.application_root+'/'+added_app[2][1:])
"""
module_app=config.apps[added_app][0]
@ -87,7 +88,7 @@ def start_app():
#Add media files support. Only for development.
@app.route('/mediafrom/<module>/<path:media_file>')
@app.route(config.application_root+'mediafrom/<module>/<path:media_file>')
def send_media_file(module, media_file):
file_path=workdir+'/themes/'+config.theme+'/media/'+module+'/'+media_file

View file

@ -269,7 +269,7 @@ def start():
pass
# Install modules
"""
if args.modules!=None:
if args.modules.strip()!='':
@ -337,18 +337,6 @@ def start():
os.chdir(args.path)
#Regenerating modules.py
regenerate='regenerate.py'
os.chmod(regenerate, 0o755)
if call('./regenerate.py', shell=True) > 0:
print('Error, cannot regenerate the modules.py script')
exit(1)
else:
print('Regeneration of modules.py finished')
# Installing models
padmin='padmin.py'

View file

@ -349,7 +349,7 @@ class WebModel:
distinct (str): Add DISTINCT keyword to self.select method.
post (dict): A simple dictionary where post values are saved for use of fields classes
files_delete (dict): A simple dictionary that save the fields that have files related. If i delete the row in database i need delete the files related
sql_class (SqlClass): A sql_class used for connect to db.
sqlclass (SqlClass): A sql_class used for connect to db.
show_formatted (bool): If True, by default all fields are showed with formatted value using show_formatted method of PhangoField classes and children in select method. If False, raw value is showed.
enctype (bool): If True, forms generated using this model are prepared for enctype=multipart/form-data A.K.A. upload files.
"""

View file

@ -1,5 +1,6 @@
# Template frontend from mako.
import gettext
from mako.template import Template
from flask import session, url_for
from mako.lookup import TemplateLookup
@ -89,6 +90,10 @@ class PTemplate:
self.add_filter(I18n.lang)
_=gettext.gettext
self.add_filter(_)
#self.add_filter(make_url)
self.add_filter(make_media_url)