Esempio n. 1
0
 def _check_status(self):
     if self._options['status']:
         match = False
         for status in common.get_statuses():
             if self._options['status'].lower() == status.lower():
                 match = True
                 self._options['status'] = status
                 break
         if (not match):
             msg = _("ERROR: Invalid status specified.")
             print msg
             raise Exception(msg)
Esempio n. 2
0
 def _check_status(self):
     if self._options['status']:
         match = False
         for status in common.get_statuses():
             if self._options['status'].lower() == status.lower():
                 match = True
                 self._options['status'] = status
                 break
         if(not match):
             msg = _("ERROR: Invalid status specified.")
             print msg
             raise Exception(msg)
Esempio n. 3
0
    def _get_status(self):
        statusesAry = common.get_statuses()
        common.print_statuses(statusesAry)

        while True:
            line = raw_input(_('Please select a status (or \'q\' '
                                       'to exit): '))
            if str(line).strip() == 'q':
                return False
            try:
                line = int(line)
            # pylint: disable=W0702
            except:
                print _("ERROR: Invalid status selection.")
            if line in range(1, len(statusesAry) + 1) and line != '':
                self._options['status'] = statusesAry[line - 1]
                break
            else:
                print _("ERROR: Invalid status selection.")
        return True
Esempio n. 4
0
    def _get_status(self):
        statusesAry = common.get_statuses()
        common.print_statuses(statusesAry)

        while True:
            line = raw_input(
                _('Please select a status (or \'q\' '
                  'to exit): '))
            if str(line).strip() == 'q':
                return False
            try:
                line = int(line)
            # pylint: disable=W0702
            except:
                print _("ERROR: Invalid status selection.")
            if line in range(1, len(statusesAry) + 1) and line != '':
                self._options['status'] = statusesAry[line - 1]
                break
            else:
                print _("ERROR: Invalid status selection.")
        return True