diff --git a/scratchclient/Project.py b/scratchclient/Project.py index 0e9d244..de4587e 100644 --- a/scratchclient/Project.py +++ b/scratchclient/Project.py @@ -315,3 +315,14 @@ def set_thumbnail(self, file): data=image.read(), headers=self._headers, ) + + def set_title(self, title): + if self.author.username != self._client.username: + raise UnauthorizedException("You are not allowed to do that") + data = { "title": title } + requests.put( + "https://api.scratch.mit.edu/projects/" + + str(self.id), + data=json.dumps(data), + headers=self._json_headers, + )