mirror of
https://github.com/wassname/cookiecutter-data-science.git
synced 2026-07-01 14:00:51 +08:00
Remove commented code
This commit is contained in:
+1
-52
@@ -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
|
||||
Reference in New Issue
Block a user