MCPcopy
hub / github.com/O365/python-o365 / _request_status

Method _request_status

O365/drive.py:175–191  ·  view source on GitHub ↗

Checks the api endpoint to check if the async job progress

(self)

Source from the content-addressed store, hash-verified

173 self.completion_percentage = 0.0
174
175 def _request_status(self):
176 """ Checks the api endpoint to check if the async job progress """
177 if self.item_id:
178 return True
179
180 response = self.con.naive_request(self.monitor_url, method="get")
181 if not response:
182 return False
183
184 data = response.json()
185
186 self.status = data.get('status', 'inProgress')
187 self.completion_percentage = data.get(self._cc('percentageComplete'),
188 0)
189 self.item_id = data.get(self._cc('resourceId'), None)
190
191 return self.item_id is not None
192
193 def check_status(self, delay=0):
194 """ Checks the api endpoint in a loop

Callers 1

check_statusMethod · 0.95

Calls 4

jsonMethod · 0.80
_ccMethod · 0.80
naive_requestMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected