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

Method delete

scratchattach/site/comment.py:196–212  ·  view source on GitHub ↗

Deletes the comment.

(self)

Source from the content-addressed store, hash-verified

194 raise ValueError(f"Unknown source: {self.source}")
195
196 def delete(self):
197 """
198 Deletes the comment.
199 """
200 self._assert_auth()
201 if self.source == CommentSource.USER_PROFILE:
202 return user.User(username=self.source_id, _session=self._session).delete_comment(comment_id=self.id)
203
204 elif self.source == CommentSource.PROJECT:
205 p = project.Project(id=self.source_id, _session=self._session)
206 p.update()
207 return p.delete_comment(comment_id=self.id)
208
209 elif self.source == CommentSource.STUDIO:
210 return studio.Studio(id=self.source_id, _session=self._session).delete_comment(comment_id=self.id)
211
212 return None # raise error?
213
214 def report(self):
215 """

Callers 10

on_messageMethod · 0.45
unloveMethod · 0.45
unfavoriteMethod · 0.45
delete_commentMethod · 0.45
report_commentMethod · 0.45
delete_commentMethod · 0.45
report_commentMethod · 0.45
remove_projectMethod · 0.45
delete_from_backpackMethod · 0.45
doctools.jsFile · 0.45

Calls 4

delete_commentMethod · 0.95
_assert_authMethod · 0.45
delete_commentMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected