Checks the api endpoint in a loop :param delay: number of seconds to wait between api calls. Note Connection 'requests_delay' also apply. :return: tuple of status and percentage complete :rtype: tuple(str, float)
(self, delay=0)
| 191 | return self.item_id is not None |
| 192 | |
| 193 | def check_status(self, delay=0): |
| 194 | """ Checks the api endpoint in a loop |
| 195 | |
| 196 | :param delay: number of seconds to wait between api calls. |
| 197 | Note Connection 'requests_delay' also apply. |
| 198 | :return: tuple of status and percentage complete |
| 199 | :rtype: tuple(str, float) |
| 200 | """ |
| 201 | if not self.item_id: |
| 202 | while not self._request_status(): |
| 203 | # wait until _request_status returns True |
| 204 | yield self.status, self.completion_percentage |
| 205 | if self.item_id is None: |
| 206 | sleep(delay) |
| 207 | else: |
| 208 | yield self.status, self.completion_percentage |
| 209 | |
| 210 | def get_item(self): |
| 211 | """ Returns the item copied |
nothing calls this directly
no test coverage detected