Parse word(wrapper for local and web parse). :returns str: string that contains the word. :raises AttributeError: Not existing enum
(self)
| 105 | self._choice_function = ch_func |
| 106 | |
| 107 | def get_word(self) -> str: |
| 108 | # noqa: DAR201 |
| 109 | """ |
| 110 | Parse word(wrapper for local and web parse). |
| 111 | |
| 112 | :returns str: string that contains the word. |
| 113 | :raises AttributeError: Not existing enum |
| 114 | """ |
| 115 | if self._source == Source.FROM_INTERNET: |
| 116 | return parse_word_from_site() |
| 117 | elif self._source == Source.FROM_FILE: |
| 118 | return parse_word_from_local(self._choice_function) |
| 119 | raise AttributeError("Non existing enum") |
| 120 | |
| 121 | def user_lose(self) -> None: |
| 122 | """Print text for end of game and exits.""" |