restored some missing regex, thanks Paolo Pastori
This commit is contained in:
1 parent
3ed69380f2
commit
0372c50ef5
2 files changed
+9
-6
No files matched your search
@@ -1082,6 +1082,9 @@ def about():
|
|||||||
return dict(app=app, about=MARKMIN(about), license=MARKMIN(license), progress=report_progress(app))
|
return dict(app=app, about=MARKMIN(about), license=MARKMIN(license), progress=report_progress(app))
|
||||||
|
|
||||||
|
|
||||||
|
regex_include = r"""(?P<all>\{\{\s*include\s+['"](?P<name>[^'"]*)['"]\s*\}\})"""
|
||||||
|
regex_extend = r"""^\s*(?P<all>\{\{\s*extend\s+['"](?P<name>[^'"]+)['"]\s*\}\})"""
|
||||||
|
|
||||||
def design():
|
def design():
|
||||||
""" Application design handler """
|
""" Application design handler """
|
||||||
app = get_app()
|
app = get_app()
|
||||||
@@ -1118,9 +1121,10 @@ def design():
|
|||||||
models = listdir(apath('%s/models/' % app, r=request), '.*\.py$')
|
models = listdir(apath('%s/models/' % app, r=request), '.*\.py$')
|
||||||
models = [x.replace('\\', '/') for x in models]
|
models = [x.replace('\\', '/') for x in models]
|
||||||
defines = {}
|
defines = {}
|
||||||
|
regex_tables = r"""^[\w]+\.define_table\(\s*['"](?P<name>\w+)['"]"""
|
||||||
for m in models:
|
for m in models:
|
||||||
data = safe_read(apath('%s/models/%s' % (app, m), r=request))
|
data = safe_read(apath('%s/models/%s' % (app, m), r=request))
|
||||||
defines[m] = regex_tables.findall(data)
|
defines[m] = re.findall(regex_tables, data, re.MULTILINE)
|
||||||
defines[m].sort()
|
defines[m].sort()
|
||||||
|
|
||||||
# Get all controllers
|
# Get all controllers
|
||||||
@@ -1144,12 +1148,12 @@ def design():
|
|||||||
include = {}
|
include = {}
|
||||||
for c in views:
|
for c in views:
|
||||||
data = safe_read(apath('%s/views/%s' % (app, c), r=request))
|
data = safe_read(apath('%s/views/%s' % (app, c), r=request))
|
||||||
items = regex_extend.findall(data)
|
items = re.findall(regex_extend, data, re.MULTILINE)
|
||||||
|
|
||||||
if items:
|
if items:
|
||||||
extend[c] = items[0][1]
|
extend[c] = items[0][1]
|
||||||
|
|
||||||
items = regex_include.findall(data)
|
items = re.findall(regex_include, data)
|
||||||
include[c] = [i[1] for i in items]
|
include[c] = [i[1] for i in items]
|
||||||
|
|
||||||
# Get all modules
|
# Get all modules
|
||||||
@@ -1285,11 +1289,11 @@ def plugin():
|
|||||||
include = {}
|
include = {}
|
||||||
for c in views:
|
for c in views:
|
||||||
data = safe_read(apath('%s/views/%s' % (app, c), r=request))
|
data = safe_read(apath('%s/views/%s' % (app, c), r=request))
|
||||||
items = regex_extend.findall(data)
|
items = re.findall(regex_extend, data, re.MULTILINE)
|
||||||
if items:
|
if items:
|
||||||
extend[c] = items[0][1]
|
extend[c] = items[0][1]
|
||||||
|
|
||||||
items = regex_include.findall(data)
|
items = re.findall(regex_include, data)
|
||||||
include[c] = [i[1] for i in items]
|
include[c] = [i[1] for i in items]
|
||||||
|
|
||||||
# Get all modules
|
# Get all modules
|
||||||
|
|||||||
@@ -25,6 +25,5 @@ from gluon.utils import md5_hash
|
|||||||
from gluon.fileutils import listdir, cleanpath, up
|
from gluon.fileutils import listdir, cleanpath, up
|
||||||
from gluon.fileutils import tar, tar_compiled, untar, fix_newlines
|
from gluon.fileutils import tar, tar_compiled, untar, fix_newlines
|
||||||
from gluon.languages import findT, update_all_languages
|
from gluon.languages import findT, update_all_languages
|
||||||
from gluon.myregex import *
|
|
||||||
from gluon.restricted import *
|
from gluon.restricted import *
|
||||||
from gluon.compileapp import compile_application, remove_compiled_application
|
from gluon.compileapp import compile_application, remove_compiled_application
|
||||||
Reference in new issue
Block a user