Ian Bicking <[EMAIL PROTECTED]> writes:

> You can subclass this class yourself, then point the paste.app_install
> entry point at the class you write.  Probably you'll want to subclass
> the config_content method.  You can do interactive stuff from within
> that class; the command argument is a paste.config.command.Command
> instance, and you can use the challenge and ask methods there.

I'm working on interactive mode support and there is an inconsistence
between .ask() and .challenge() regarding lack of default value that
really annoys me.  I think you'll like my solution:

  http://trac.pythonpaste.org/pythonpaste/ticket/205

-- 
Yannick Gingras
Index: paste/script/command.py
===================================================================
--- paste/script/command.py	(revision 7040)
+++ paste/script/command.py	(working copy)
@@ -242,9 +242,10 @@
 
     def ask(self, prompt, safe=False, default=True):
         """
-        Prompt the user.  Default can be true, false, ``'careful'`` or
-        ``'none'``.  If ``'none'`` then the user must enter y/n.  If
-        ``'careful'`` then the user must enter yes/no (long form).
+        Prompt the user.  Default can be true, false, ``'careful'``,
+        ``'none'``, or the ``NoDefault`` class.  If ``'none'`` or
+        ``NoDefault`` then the user must enter y/n.  If ``'careful'``
+        then the user must enter yes/no (long form).
 
         If the interactive option is over two (``-ii``) then ``safe``
         will be used as a default.  This option should be the
@@ -256,7 +257,7 @@
             default = safe
         if default == 'careful':
             prompt += ' [yes/no]?'
-        elif default == 'none':
+        elif default == 'none' or default == NoDefault:
             prompt += ' [y/n]?'
         elif default:
             prompt += ' [Y/n]? '
_______________________________________________
Paste-users mailing list
[email protected]
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users

Reply via email to