You can only use this function if this object was created using :meth:`scratchattach.session.Session.connect_project`
(self, *, file)
| 644 | self.set_fields({"id":int(self.id), "visibility": "trshbyusr", "isPublished" : False}, use_site_api=True)''' |
| 645 | |
| 646 | def set_thumbnail(self, *, file): |
| 647 | """ |
| 648 | You can only use this function if this object was created using :meth:`scratchattach.session.Session.connect_project` |
| 649 | """ |
| 650 | self._assert_permission() |
| 651 | with open(file, "rb") as f: |
| 652 | thumbnail = f.read() |
| 653 | requests.post( |
| 654 | f"https://scratch.mit.edu/internalapi/project/thumbnail/{self.id}/set/", |
| 655 | data=thumbnail, |
| 656 | headers=self._headers, |
| 657 | cookies=self._cookies, |
| 658 | ) |
| 659 | |
| 660 | def delete_comment(self, *, comment_id): |
| 661 | """ |
nothing calls this directly
no test coverage detected