toolsutils.py
changeset 2615 1ea41b7c0836
parent 2476 1294a6bdf3bf
child 2790 968108e16066
child 3115 29262ba01464
--- a/toolsutils.py	Fri Jul 31 23:22:19 2009 +0200
+++ b/toolsutils.py	Fri Jul 31 23:26:52 2009 +0200
@@ -16,7 +16,7 @@
 from logilab.common.clcommands import Command as BaseCommand, \
      main_run as base_main_run
 from logilab.common.compat import any
-from logilab.common.shellutils import confirm
+from logilab.common.shellutils import ASK
 
 from cubicweb import warning
 from cubicweb import ConfigurationError, ExecutionError
@@ -72,7 +72,7 @@
         if askconfirm:
             print
             print diffs
-            action = raw_input('replace (N/y/q) ? ').lower()
+            action = ASK.ask('Replace ?', ('N','y','q'), 'N')
         else:
             action = 'y'
         if action == 'y':
@@ -117,7 +117,7 @@
             if fname.endswith('.tmpl'):
                 tfpath = tfpath[:-5]
                 if not askconfirm or not exists(tfpath) or \
-                       confirm('%s exists, overwrite?' % tfpath):
+                       ASK.confirm('%s exists, overwrite?' % tfpath):
                     fill_templated_file(fpath, tfpath, context)
                     print '[generate] %s <-- %s' % (tfpath, fpath)
             elif exists(tfpath):