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

Method target_comment

scratchattach/site/activity.py:388–408  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

386 return None
387
388 def target_comment(self) -> Optional[comment.Comment]:
389 # TODO: make use of self.target_project/target_user/target_studio here.
390 # Also why is there no use of studio here??? This needs to be tested
391 if self.comment_type == 0:
392 if self.comment_obj_id is None:
393 return None
394
395 # we need author name, but it has not been saved in this object
396 if self._session is not None:
397 _proj = self._session.connect_project(self.comment_obj_id)
398 else:
399 _proj = project.Project(id=self.comment_obj_id)
400
401 return _proj.comment_by_id(self.comment_id)
402
403 elif self.comment_type == 1:
404 return user.User(username=self.comment_obj_title, _session=self._session).comment_by_id(self.comment_id)
405 elif self.comment_type == 2:
406 return user.User(id=self.comment_obj_id, _session=self._session).comment_by_id(self.comment_id)
407 else:
408 return None
409
410 def target(self):
411 """

Callers 2

targetMethod · 0.95
on_messageMethod · 0.80

Calls 3

comment_by_idMethod · 0.95
connect_projectMethod · 0.80
comment_by_idMethod · 0.45

Tested by

no test coverage detected