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