MCPcopy Create free account
hub / github.com/TimMcCool/scratchattach / set_working_on

Method set_working_on

scratchattach/site/classroom.py:244–260  ·  view source on GitHub ↗
(self, status: str)

Source from the content-addressed store, hash-verified

242 raise e
243
244 def set_working_on(self, status: str) -> None:
245 self._check_session()
246 response = requests.put(f"https://scratch.mit.edu/site-api/classrooms/all/{self.id}/",
247 headers=self._headers, cookies=self._cookies,
248 json={"status": status})
249
250 try:
251 data = response.json()
252 if data["status"] == status:
253 # Success!
254 return
255 else:
256 warnings.warn(f"{self._session} may not be authenticated to edit {self}")
257
258 except Exception as e:
259 warnings.warn(f"{self._session} may not be authenticated to edit {self}")
260 raise e
261
262 def set_title(self, title: str) -> None:
263 self._check_session()

Callers

nothing calls this directly

Calls 3

_check_sessionMethod · 0.95
putMethod · 0.80
jsonMethod · 0.80

Tested by

no test coverage detected