Ticket #205: paste-ask-nodefault.diff
| File paste-ask-nodefault.diff, 1.2 KB (added by ygingras, 5 years ago) |
|---|
-
paste/script/command.py
242 242 243 243 def ask(self, prompt, safe=False, default=True): 244 244 """ 245 Prompt the user. Default can be true, false, ``'careful'`` or 246 ``'none'``. If ``'none'`` then the user must enter y/n. If 247 ``'careful'`` then the user must enter yes/no (long form). 245 Prompt the user. Default can be true, false, ``'careful'``, 246 ``'none'``, or the ``NoDefault`` class. If ``'none'`` or 247 ``NoDefault`` then the user must enter y/n. If ``'careful'`` 248 then the user must enter yes/no (long form). 248 249 249 250 If the interactive option is over two (``-ii``) then ``safe`` 250 251 will be used as a default. This option should be the … … 256 257 default = safe 257 258 if default == 'careful': 258 259 prompt += ' [yes/no]?' 259 elif default == 'none' :260 elif default == 'none' or default == NoDefault: 260 261 prompt += ' [y/n]?' 261 262 elif default: 262 263 prompt += ' [Y/n]? '
