mypy: Adjust board_actions.py to allow Optional[Text] values.

This commit is contained in:
neiljp (Neil Pilgrim)
2017-09-24 15:35:01 -07:00
committed by Greg Price
parent 9cec8f08d1
commit e6daee441b

View File

@@ -24,14 +24,14 @@ ACTIONS_TO_MESSAGE_MAPPER = {
}
def process_board_action(payload, action_type):
# type: (Mapping[str, Any], Text) -> Optional[Tuple[Text, Text]]
# type: (Mapping[str, Any], Optional[Text]) -> Optional[Tuple[Text, Text]]
action_type = get_proper_action(payload, action_type)
if action_type is not None:
return get_subject(payload), get_body(payload, action_type)
return None
def get_proper_action(payload, action_type):
# type: (Mapping[str, Any], Text) -> Optional[Text]
# type: (Mapping[str, Any], Optional[Text]) -> Optional[Text]
if action_type == 'updateBoard':
data = get_action_data(payload)
# we don't support events for when a board's background