def message_identifier(self, state: str) -> str:
     message_switcher: Dict[str, str] = {
         self.example_state: 'example state message'
     }
     if state in message_switcher:
         return message_switcher[state]
     else:
         raise ValueNotFoundError(self.name, state, 'message')
Ejemplo n.º 2
0
 def message_identifier(self, state: str) -> str:
     message_switcher: Dict[str, str] = {
         self.BRANCH_CLEAN: self.name + ' is clean',
         self.BRANCH_DIRTY: self.name + ' is dirty'
     }
     if state in message_switcher:
         return message_switcher[state]
     else:
         raise ValueNotFoundError(self.name, state, 'message')
Ejemplo n.º 3
0
 def message_identifier(self, state: str) -> str:
     message_switcher: Dict[str, str] = {
         self.NOTIFY: self.name + ' is within the desired time range',
         self.SLEEP: self.name + ' is not within the desired time range'
     }
     if state in message_switcher:
         return message_switcher[state]
     else:
         raise ValueNotFoundError(self.name, state, 'message')
Ejemplo n.º 4
0
 def color_identifier(self, state: str) -> str:
     color_switcher: Dict[str, str] = {
         self.NOTIFY: COLORS['orange'],
         self.SLEEP: COLORS['light blue']
     }
     if state in color_switcher:
         return color_switcher[state]
     else:
         raise ValueNotFoundError(self.name, state, 'color')
Ejemplo n.º 5
0
 def color_identifier(self, state: str) -> str:
     color_switcher: Dict[str, str] = {
         self.BRANCH_CLEAN: COLORS['light blue'],
         self.BRANCH_DIRTY: COLORS['purple']
     }
     if state in color_switcher:
         return color_switcher[state]
     else:
         raise ValueNotFoundError(self.name, state, 'color')
Ejemplo n.º 6
0
 def color_identifier(self, state: str) -> str:
     color_switcher: Dict[str, str] = {
         self.READ_MESSAGES: COLORS['light blue'],
         self.UNREAD_MESSAGES: COLORS['light green']
     }
     if state in color_switcher:
         return color_switcher[state]
     else:
         raise ValueNotFoundError(self.name, state, 'color')
Ejemplo n.º 7
0
 def message_identifier(self, state: str) -> str:
     message_switcher: Dict[str, str] = {
         'SUCCESS': 'was successful',
         'FAILURE': 'failed',
         'UNSTABLE': 'was unstable'
     }
     if state in message_switcher:
         return (self.name + ': the last build ' + message_switcher[state])
     else:
         raise ValueNotFoundError(self.name, state, 'message')
Ejemplo n.º 8
0
 def color_identifier(self, state: str) -> str:
     color_switcher: Dict[str, str] = {
         'SUCCESS': COLORS['light green'],
         'FAILURE': COLORS['red'],
         'UNSTABLE': COLORS['yellow']
     }
     if state in color_switcher:
         return color_switcher[state]
     else:
         raise ValueNotFoundError(self.name, state, 'color')
Ejemplo n.º 9
0
 def message_identifier(self, state: str) -> str:
     message_switcher: Dict[str, str] = {
         self.OFF: self.name + ' has turned off',
         self.LOW: self.name + ' is running (low)',
         self.MEDIUM: self.name + ' is running (medium)',
         self.HIGH: self.name + ' is running (high)'
     }
     if state in message_switcher:
         return message_switcher[state]
     else:
         raise ValueNotFoundError(self.name, state, 'message')
Ejemplo n.º 10
0
 def color_identifier(self, state: str) -> str:
     color_switcher: Dict[str, str] = {
         self.OFF: COLORS['red'],
         self.LOW: COLORS['orange'],
         self.MEDIUM: COLORS['yellow'],
         self.HIGH: COLORS['light green']
     }
     if state in color_switcher:
         return color_switcher[state]
     else:
         raise ValueNotFoundError(self.name, state, 'color')
Ejemplo n.º 11
0
 def color_identifier(self, state: str) -> str:
     color_switcher: Dict[str, str] = {
         self.UP_TO_DATE: COLORS['light blue'],
         self.BEHIND: COLORS['purple'],
         self.AHEAD: COLORS['orange'],
         self.DETACHED: COLORS['red']
     }
     if state in color_switcher:
         return color_switcher[state]
     else:
         raise ValueNotFoundError(self.name, state, 'color')
 def message_identifier(self, state: str) -> str:
     message_switcher: Dict[str, str] = {
         self.MAIN_BRANCH: (self.name + ' is on the main branch: ' +
                            self.current_branch_name),
         self.FEATURE_BRANCH: (self.name + ' is on the feature branch: ' +
                               self.current_branch_name)
     }
     if state in message_switcher:
         return message_switcher[state]
     else:
         raise ValueNotFoundError(self.name, state, 'message')
Ejemplo n.º 13
0
 def message_identifier(self, state: str) -> str:
     message_switcher: Dict[str, str] = {
         self.UNREAD_MESSAGES: (str(len(self._desired_messages)) +
                                ' new message(s) found from ' + self.name),
         self.READ_MESSAGES:
         'No new message(s) found from ' + self.name
     }
     if state in message_switcher:
         return message_switcher[state]
     else:
         raise ValueNotFoundError(self.name, state, 'message')
Ejemplo n.º 14
0
 def message_identifier(self, state: str) -> str:
     message_switcher: Dict[str, str] = {
         self.READ_ALERT: ('There are no new alerts on ' + self.route_id),
         self.UNREAD_ALERT: (('There is 1 new alert on  ' +
                              self.route_id) if self.num_alerts == 1 else
                             ('There are ' + str(self.num_alerts) +
                              ' new alerts on ' + self.route_id))
     }
     if state in message_switcher:
         return message_switcher[state]
     else:
         raise ValueNotFoundError(self.name, state, 'message')
Ejemplo n.º 15
0
 def color_identifier(self, state: str) -> str:
     color_switcher: Dict[str, str] = {
         self.POWEROFF: COLORS['red'],
         self.ABORTED: COLORS['red'],
         self.RUNNING: COLORS['light green'],
         self.RESTORING: COLORS['light green'],
         self.SAVED: COLORS['light blue'],
         self.SAVING: COLORS['light blue']
     }
     if state in color_switcher:
         return color_switcher[state]
     else:
         raise ValueNotFoundError(self.name, state, 'color')
Ejemplo n.º 16
0
 def message_identifier(self, state: str) -> str:
     message_switcher: Dict[str, str] = {
         self.POWEROFF: 'Your vagrant is off',
         self.ABORTED: 'Your vagrant is aborted',
         self.RUNNING: 'Your vagrant is running',
         self.RESTORING: 'Your vagrant is running',
         self.SAVED: 'Your vagrant is suspended',
         self.SAVING: 'Your vagrant is suspended'
     }
     if state in message_switcher:
         return message_switcher[state]
     else:
         raise ValueNotFoundError(self.name, state, 'message')
Ejemplo n.º 17
0
 def message_identifier(self, state: str) -> str:
     message_switcher: Dict[str, str] = {
         self.READ_VERSION:
         ('Value at ' + str(self.yaml_url) + ' remains at ' +
          str(self._most_recent_version)),
         self.UNREAD_VERSION:
         ('Value at ' + str(self.yaml_url) + ' has ' + 'changed to ' +
          str(self._most_recent_version))
     }
     if state in message_switcher:
         return message_switcher[state]
     else:
         raise ValueNotFoundError(self.name, state, 'message')
Ejemplo n.º 18
0
 def message_identifier(self, state: str) -> str:
     message_switcher: Dict[str, str] = {
         self.UP_TO_DATE:
         (self.name + ' is up to date on the current branch'),
         self.AHEAD: (self.name + ' is ahead by ' + str(self.number_away) +
                      ' commits on the current branch'),
         self.BEHIND:
         (self.name + ' is behind by ' + str(0 - self.number_away) +
          ' commits on the current branch'),
         self.DETACHED:
         self.name + ' has a detached head'
     }
     if state in message_switcher:
         return message_switcher[state]
     else:
         raise ValueNotFoundError(self.name, state, 'message')
Ejemplo n.º 19
0
 def color_identifier(self, state: str) -> str:
     color_switcher: Dict[str, str] = {self.example_state: COLORS['red']}
     if state in color_switcher:
         return color_switcher[state]
     else:
         raise ValueNotFoundError(self.name, state, 'color')