From bc7b17b66f5855a90dfbe3d89bf36254b5302bb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 29 Oct 2015 18:58:51 +0100 Subject: [PATCH] Fixed an issue with compatibility across cookiecutter versions --- src/octoprint/cli/devel.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/octoprint/cli/devel.py b/src/octoprint/cli/devel.py index 50155f28..4c3ced4e 100644 --- a/src/octoprint/cli/devel.py +++ b/src/octoprint/cli/devel.py @@ -83,17 +83,15 @@ class OctoPrintDevelCommands(click.MultiCommand): cookiecutter_dict = {} env = cookiecutter.prompt.Environment() - for key, raw in cookiecutter.prompt.iteritems(context['cookiecutter']): + for key, raw in context['cookiecutter'].items(): if key in options: val = options[key] else: - raw = raw if cookiecutter.prompt.is_string(raw) else str(raw) + raw = raw if isinstance(raw, basestring) else str(raw) val = env.from_string(raw).render(cookiecutter=cookiecutter_dict) if not no_input: - new_val = click.prompt(key, default=val) - if new_val != "": - val = new_val + val = click.prompt(key, default=val) cookiecutter_dict[key] = val return cookiecutter_dict