misc: pylint fix using-constant-test (#52222)
This commit is contained in:
parent
d88dd530f6
commit
021b73d4fb
|
@ -380,30 +380,29 @@ def decorate(body, response):
|
|||
from .publisher import get_cfg
|
||||
|
||||
generate_breadcrumb = True
|
||||
if True:
|
||||
template_ezt = get_cfg('branding', {}).get('template')
|
||||
current_theme = get_cfg('branding', {}).get('theme', 'default')
|
||||
if not template_ezt:
|
||||
# the theme can provide a default template
|
||||
possible_filenames = []
|
||||
possible_filenames.append('template.%s.ezt' % get_publisher().APP_NAME)
|
||||
possible_filenames.append('template.ezt')
|
||||
template_ezt = get_cfg('branding', {}).get('template')
|
||||
current_theme = get_cfg('branding', {}).get('theme', 'default')
|
||||
if not template_ezt:
|
||||
# the theme can provide a default template
|
||||
possible_filenames = []
|
||||
possible_filenames.append('template.%s.ezt' % get_publisher().APP_NAME)
|
||||
possible_filenames.append('template.ezt')
|
||||
|
||||
possible_dirnames = [
|
||||
os.path.join(get_publisher().app_dir, 'themes', current_theme),
|
||||
os.path.join(get_publisher().data_dir, 'themes', current_theme),
|
||||
os.path.join(get_publisher().data_dir, 'themes', 'default'),
|
||||
]
|
||||
possible_dirnames = [
|
||||
os.path.join(get_publisher().app_dir, 'themes', current_theme),
|
||||
os.path.join(get_publisher().data_dir, 'themes', current_theme),
|
||||
os.path.join(get_publisher().data_dir, 'themes', 'default'),
|
||||
]
|
||||
|
||||
for fname in possible_filenames:
|
||||
for dname in possible_dirnames:
|
||||
filename = os.path.join(dname, fname)
|
||||
if os.path.exists(filename):
|
||||
template_ezt = open(filename).read()
|
||||
break
|
||||
else:
|
||||
continue
|
||||
break
|
||||
for fname in possible_filenames:
|
||||
for dname in possible_dirnames:
|
||||
filename = os.path.join(dname, fname)
|
||||
if os.path.exists(filename):
|
||||
template_ezt = open(filename).read()
|
||||
break
|
||||
else:
|
||||
continue
|
||||
break
|
||||
|
||||
if template_ezt:
|
||||
generate_breadcrumb = '[breadcrumb]' in template_ezt
|
||||
|
|
Loading…
Reference in New Issue