Find templates if package is installed
Find templates if the package is installed on the system. Change-Id: Iefe71e9ea3e43cf2fce55307d698600bed0ef9f3
This commit is contained in:
@@ -78,8 +78,16 @@ def get_options():
|
|||||||
'dasbhoard files')
|
'dasbhoard files')
|
||||||
parser.add_argument('--template', default='single.txt',
|
parser.add_argument('--template', default='single.txt',
|
||||||
help='Name of template')
|
help='Name of template')
|
||||||
|
|
||||||
|
# Find path to template_dir
|
||||||
|
# We need to support running with and without installation
|
||||||
|
if os.path.exists('templates'):
|
||||||
|
template_dir = 'templates'
|
||||||
|
else:
|
||||||
|
template_dir = os.path.join(sys.prefix, 'share',
|
||||||
|
'gerrit-dash-creator', 'templates')
|
||||||
parser.add_argument('--template-directory',
|
parser.add_argument('--template-directory',
|
||||||
default="templates",
|
default=template_dir,
|
||||||
help='Directory to scan for template files')
|
help='Directory to scan for template files')
|
||||||
parser.add_argument('--template-file', default=None,
|
parser.add_argument('--template-file', default=None,
|
||||||
help='Location of a specific template file')
|
help='Location of a specific template file')
|
||||||
|
|||||||
Reference in New Issue
Block a user