Mercurial > libervia-backend
diff frontends/src/jp/cmd_pubsub.py @ 2550:1d754bc14381
jp (base): new confirmOrQuit helper method to ask confirmation to user, and quit if he cancel
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 31 Mar 2018 18:21:56 +0200 |
parents | dcc77f23e370 |
children |
line wrap: on
line diff
--- a/frontends/src/jp/cmd_pubsub.py Sat Mar 31 17:20:38 2018 +0200 +++ b/frontends/src/jp/cmd_pubsub.py Sat Mar 31 18:21:56 2018 +0200 @@ -140,11 +140,7 @@ else: message = _(u"Are you sure to delete node [{node_id}] on service [{service}] ?").format( node_id=self.args.node, service=self.args.service) - - res = raw_input("{} (y/N)? ".format(message)) - if res not in ("y", "Y"): - self.disp(_(u"node deletion cancelled")) - self.host.quit(2) + self.host.confirmOrQuit(message, _(u"node deletion cancelled")) self.host.bridge.psNodeDelete( self.args.service, @@ -572,10 +568,7 @@ self.parser.error(_(u"You need to specify an item to delete")) if not self.args.force: message = _(u"Are you sure to delete item {item_id} ?").format(item_id=self.args.item) - res = raw_input("{} (y/N)? ".format(message)) - if res not in ("y", "Y"): - self.disp(_(u"Item deletion cancelled")) - self.host.quit(2) + self.host.confirmOrQuit(message, _(u"item deletion cancelled")) self.host.bridge.psRetractItem( self.args.service, self.args.node,