MCPcopy Index your code
hub / github.com/python/cpython / _add_message

Method _add_message

Tools/i18n/pygettext.py:582–609  ·  view source on GitHub ↗
(
            self, lineno, msgid, msgid_plural=None, msgctxt=None, *,
            is_docstring=False, comments=None)

Source from the content-addressed store, hash-verified

580 return comment.startswith(self.options.comment_tags)
581
582 def _add_message(
583 self, lineno, msgid, msgid_plural=None, msgctxt=None, *,
584 is_docstring=False, comments=None):
585 if msgid in self.options.toexclude:
586 return
587
588 if not comments:
589 comments = []
590
591 key = self._key_for(msgid, msgctxt)
592 message = self.messages.get(key)
593 if message:
594 message.add_location(
595 self.filename,
596 lineno,
597 msgid_plural,
598 is_docstring=is_docstring,
599 comments=comments,
600 )
601 else:
602 self.messages[key] = Message(
603 msgid=msgid,
604 msgid_plural=msgid_plural,
605 msgctxt=msgctxt,
606 locations={Location(self.filename, lineno)},
607 is_docstring=is_docstring,
608 comments=comments,
609 )
610
611 @staticmethod
612 def _key_for(msgid, msgctxt=None):

Callers 2

_extract_docstringMethod · 0.95

Calls 5

_key_forMethod · 0.95
LocationClass · 0.85
add_locationMethod · 0.80
MessageClass · 0.70
getMethod · 0.45

Tested by

no test coverage detected