Files
pgadmin4/web/pgadmin/utils/compile_template_name.py
T

31 lines
1.1 KiB
Python
Raw Normal View History

2018-02-09 11:54:42 +00:00
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
2021-01-04 15:34:45 +05:30
# Copyright (C) 2013 - 2021, The pgAdmin Development Team
2018-02-09 11:54:42 +00:00
# This software is released under the PostgreSQL Licence
#
##########################################################################
2018-02-26 13:54:58 +00:00
def compile_template_name(
template_prefix, template_file_name, server_type, version):
2018-03-13 12:45:14 -04:00
# 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):
2018-02-09 11:54:42 +00:00
if server_type == 'gpdb':
version_path = '#{0}#{1}#'.format(server_type, version)
else:
version_path = '#{0}#'.format(version)
2018-03-13 12:45:14 -04:00
# 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