user_data.py
¶
Functions used to load user data.
cast_answer_type(answer, type_fn)
¶
Cast answer to expected type.
Source code in copier/config/user_data.py
103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
load_answersfile_data(dst_path, answers_file=None)
¶
Load answers data from a $dst_path/$answers_file
file if it exists.
Source code in copier/config/user_data.py
92 93 94 95 96 97 98 99 100 |
|
load_config_data(src_path, quiet=False, _warning=True)
¶
Try to load the content from a copier.yml
or a copier.yaml
file.
Source code in copier/config/user_data.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
parse_yaml_string(string)
¶
Parse a YAML string and raise a ValueError if parsing failed.
This method is needed because :meth:prompt
requires a ValueError
to repeat falied questions.
Source code in copier/config/user_data.py
61 62 63 64 65 66 67 68 69 70 |
|
query_user_data(questions_data, last_answers_data, forced_answers_data, ask_user, envops)
¶
Query the user for questions given in the config file.
Source code in copier/config/user_data.py
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
|
render_choices(choices, env, context)
¶
Render a list or dictionary of templated choices using Jinja.
Source code in copier/config/user_data.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
|
render_value(value, env, context)
¶
Render a single templated value using Jinja.
If the value cannot be used as a template, it will be returned as is.
Source code in copier/config/user_data.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
|