本文整理汇总了Python中babel.messages.catalog.Catalog.obsolete[msgid]方法的典型用法代码示例。如果您正苦于以下问题:Python Catalog.obsolete[msgid]方法的具体用法?Python Catalog.obsolete[msgid]怎么用?Python Catalog.obsolete[msgid]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类babel.messages.catalog.Catalog
的用法示例。
在下文中一共展示了Catalog.obsolete[msgid]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_po_with_multiline_obsolete_message
# 需要导入模块: from babel.messages.catalog import Catalog [as 别名]
# 或者: from babel.messages.catalog.Catalog import obsolete[msgid] [as 别名]
def test_po_with_multiline_obsolete_message(self):
catalog = Catalog()
catalog.add(u'foo', u'Voh', locations=[('main.py', 1)])
msgid = r"""Here's a message that covers
multiple lines, and should still be handled
correctly.
"""
msgstr = r"""Here's a message that covers
multiple lines, and should still be handled
correctly.
"""
catalog.obsolete[msgid] = Message(msgid, msgstr,
locations=[('utils.py', 3)])
buf = BytesIO()
pofile.write_po(buf, catalog, omit_header=True)
self.assertEqual(b'''#: main.py:1
msgid "foo"
msgstr "Voh"
#~ msgid ""
#~ "Here's a message that covers\\n"
#~ "multiple lines, and should still be handled\\n"
#~ "correctly.\\n"
#~ msgstr ""
#~ "Here's a message that covers\\n"
#~ "multiple lines, and should still be handled\\n"
#~ "correctly.\\n"''', buf.getvalue().strip())