diff --git a/ccds/monkey_patch.py b/ccds/monkey_patch.py index 5a3c7bb..84d11cc 100644 --- a/ccds/monkey_patch.py +++ b/ccds/monkey_patch.py @@ -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 \ No newline at end of file