From ca33694ecbec9d52c02a70fee3c62afa8d55994a Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Fri, 26 Jun 2015 20:17:06 +0000 Subject: [PATCH] fix default template directory Using pkg_resources assumes that the template files will be installed inside the python package, which they aren't. Update the default to be simply "templates", which allows someone to use the dashboard creator with: tox -e venv -- gerrit-dash-creator dashboards/cross-project.dash Change-Id: I95adbbfcc4477eac1be07f4a5beec6a8e3ae093a --- gerrit_dash_creator/cmd/creator.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gerrit_dash_creator/cmd/creator.py b/gerrit_dash_creator/cmd/creator.py index 5e167b8..752662d 100755 --- a/gerrit_dash_creator/cmd/creator.py +++ b/gerrit_dash_creator/cmd/creator.py @@ -19,7 +19,6 @@ import sys import urllib import jinja2 -import pkg_resources import six from six.moves import configparser @@ -80,9 +79,8 @@ def get_options(): parser.add_argument('--template', default='single.txt', help='Name of template') parser.add_argument('--template-directory', - default=pkg_resources.resource_filename( - __name__, "templates" - ), help='Directory to scan for template files') + default="templates", + help='Directory to scan for template files') parser.add_argument('--template-file', default=None, help='Location of a specific template file') return parser.parse_args()