Example #1
0
 def confirm(self, msg, allow_all=False, forced=False):
     '''confirm a change'''
     if not self.fix:
         return False
     if self.quiet:
         return self.yes
     if self.yes:
         forced = True
     return common.confirm(msg, forced=forced, allow_all=allow_all)
Example #2
0
 def confirm(self, msg, allow_all=False, forced=False):
     '''confirm a change'''
     if not self.fix:
         return False
     if self.quiet:
         return self.yes
     if self.yes:
         forced = True
     return common.confirm(msg, forced=forced, allow_all=allow_all)
Example #3
0
 def confirm_all(self, msg, all_attr):
     '''confirm a change with support for "all" '''
     if not self.fix:
         return False
     if self.quiet:
         return self.yes
     if getattr(self, all_attr) == 'NONE':
         return False
     if getattr(self, all_attr) == 'ALL':
         forced = True
     else:
         forced = self.yes
     c = common.confirm(msg, forced=forced, allow_all=True)
     if c == 'ALL':
         setattr(self, all_attr, 'ALL')
         return True
     if c == 'NONE':
         setattr(self, all_attr, 'NONE')
         return True
     return c
Example #4
0
 def confirm_all(self, msg, all_attr):
     '''confirm a change with support for "all" '''
     if not self.fix:
         return False
     if self.quiet:
         return self.yes
     if getattr(self, all_attr) == 'NONE':
         return False
     if getattr(self, all_attr) == 'ALL':
         forced = True
     else:
         forced = self.yes
     c = common.confirm(msg, forced=forced, allow_all=True)
     if c == 'ALL':
         setattr(self, all_attr, 'ALL')
         return True
     if c == 'NONE':
         setattr(self, all_attr, 'NONE')
         return False
     return c