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

Method set_description

scratchattach/site/classroom.py:226–242  ·  view source on GitHub ↗
(self, desc: str)

Source from the content-addressed store, hash-verified

224 files={"file": thumbnail})
225
226 def set_description(self, desc: str) -> None:
227 self._check_session()
228 response = requests.put(f"https://scratch.mit.edu/site-api/classrooms/all/{self.id}/",
229 headers=self._headers, cookies=self._cookies,
230 json={"description": desc})
231
232 try:
233 data = response.json()
234 if data["description"] == desc:
235 # Success!
236 return
237 else:
238 warnings.warn(f"{self._session} may not be authenticated to edit {self}")
239
240 except Exception as e:
241 warnings.warn(f"{self._session} may not be authenticated to edit {self}")
242 raise e
243
244 def set_working_on(self, status: str) -> None:
245 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