(self, title: str)
| 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() |
nothing calls this directly
no test coverage detected