(self, text, src, dest, suggestion)
| 124 | raise UnexpectedError from exc |
| 125 | |
| 126 | async def suggest(self, text, src, dest, suggestion): |
| 127 | src, dest = self.denormalize_lang(src, dest) |
| 128 | |
| 129 | # Form data |
| 130 | data = { |
| 131 | "q": text, |
| 132 | "source": src, |
| 133 | "target": dest, |
| 134 | "s": suggestion, |
| 135 | } |
| 136 | if self.api_key and ProviderFeature.API_KEY in self.features: |
| 137 | data["api_key"] = self.api_key |
| 138 | |
| 139 | # Do request |
| 140 | response = await self.post(self.suggest_url, data, form=True) |
| 141 | try: |
| 142 | return response.get("success", False) |
| 143 | except: # noqa |
| 144 | return False |
| 145 | |
| 146 | def check_known_errors(self, status, data): |
| 147 | if not data: |
nothing calls this directly
no test coverage detected