Remove commented code

This commit is contained in:
Peter Bull
2019-03-22 15:54:29 -07:00
parent a5b1f9a41d
commit a488a4cf65
+1 -52
View File
@@ -102,55 +102,4 @@ def prompt_for_config(context, no_input=False):
msg = "Unable to render variable '{}'".format(key)
raise UndefinedVariableInTemplate(msg, err, context)
return cookiecutter_dict
# from cookiecutter.main import cookiecutter
# from cookiecutter import prompt
# from cookiecutter.cli import main as cc_main
# class NestedQuestion:
# ''' [{'a': {'val1': 'default1', 'val2': 'default2'}}]
# Interprets lists as questions with multiple options, where the
# and dictionaries as single questions with defaults values.
# '''
# @classmethod
# def update_context(cls, context, question_structure):
# qd = question_structure
# if isinstance(qd, list):
# selection = cls.get_user_option(qd)
# name, vals = list(selection.items())[0]
# context[name] = {}
# cls.update_context(context[name], vals)
# elif isinstance(qd, dict):
# for k, v in qd.items():
# context[k]= {}
# if isinstance(v, (dict, list)):
# context[k] = cls.update_context(context[k], v)
# else:
# context[k] = cls.get_user_input(k, v)
# return context
# @staticmethod
# def get_user_input(key, default):
# return prompt.read_user_variable(key, default)
# # return input(f"{key} [{default}]: ") or default
# @staticmethod
# def get_user_option(options):
# prompt.read_user_choice()
# # input_msg = '\n'.join(
# # f" [{ix + 1}] - {list(value.keys())[0]}" for ix, value in enumerate(options)
# # )
# # prepend = 'Select an item:\n'
# # postpend = "\n - Enter number [1]: "
# # ix = int(input(prepend + input_msg + postpend) or 1) - 1
# # return options[ix]
return cookiecutter_dict