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

Method set_title

scratchattach/site/classroom.py:262–278  ·  view source on GitHub ↗
(self, title: str)

Source from the content-addressed store, hash-verified

260 raise e
261
262 def set_title(self, title: str) -> None:
263 self._check_session()
264 response = requests.put(f"https://scratch.mit.edu/site-api/classrooms/all/{self.id}/",
265 headers=self._headers, cookies=self._cookies,
266 json={"title": title})
267
268 try:
269 data = response.json()
270 if data["title"] == title:
271 # Success!
272 return
273 else:
274 warnings.warn(f"{self._session} may not be authenticated to edit {self}")
275
276 except Exception as e:
277 warnings.warn(f"{self._session} may not be authenticated to edit {self}")
278 raise e
279
280 def add_studio(self, name: str, description: str = '') -> None:
281 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