pgadmin4/web/pgadmin/utils/compile_template_name.py

29 lines
1002 B
Python
Raw Normal View History

##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
2022-01-04 02:24:25 -06:00
# Copyright (C) 2013 - 2022, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
2018-02-26 07:54:58 -06:00
def compile_template_name(
template_prefix, template_file_name, server_type, version):
# Template path concatenation should be same as
# Ref: ../pgadmin4/web/pgadmin/utils/versioned_template_loader.py +54
# to avoid path mismatch in windows
return compile_template_path(template_prefix, server_type, version) + \
'/' + template_file_name
def compile_template_path(template_prefix, server_type, version):
version_path = '#{0}#'.format(version)
# Template path concatenation should be same as
# Ref: ../pgadmin4/web/pgadmin/utils/versioned_template_loader.py +54
# to avoid path mismatch in windows
return template_prefix + '/' + version_path