本文整理汇总了Python中ics.event.Event.description方法的典型用法代码示例。如果您正苦于以下问题:Python Event.description方法的具体用法?Python Event.description怎么用?Python Event.description使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ics.event.Event
的用法示例。
在下文中一共展示了Event.description方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_escapte_output
# 需要导入模块: from ics.event import Event [as 别名]
# 或者: from ics.event.Event import description [as 别名]
def test_escapte_output(self):
e = Event()
e.name = "Hello, with \\ spechial; chars and \n newlines"
e.location = "Here; too"
e.description = "Every\nwhere ! Yes, yes !"
e.created = arrow.Arrow(2013, 1, 1)
e.uid = "empty-uid"
eq = CRLF.join(("BEGIN:VEVENT",
"DTSTAMP:20130101T000000Z",
"SUMMARY:Hello\\, with \\\\ spechial\\; chars and \\n newlines",
"DESCRIPTION:Every\\nwhere ! Yes\\, yes !",
"LOCATION:Here\\; too",
"UID:empty-uid",
"END:VEVENT"))
self.assertEqual(str(e), eq)
示例2: test_escape_output
# 需要导入模块: from ics.event import Event [as 别名]
# 或者: from ics.event.Event import description [as 别名]
def test_escape_output(self):
e = Event()
e.name = "Hello, with \\ spechial; chars and \n newlines"
e.location = "Here; too"
e.description = "Every\nwhere ! Yes, yes !"
e.created = datetime(2013, 1, 1, tzinfo=tzutc)
e.uid = "empty-uid"
output = str(e).splitlines()
self.assertEqual(output[0], "BEGIN:VEVENT")
self.assertEqual(output[-1], "END:VEVENT")
eq = set(("DTSTAMP:20130101T000000Z",
"SUMMARY:Hello\\, with \\\\ spechial\\; chars and \\n newlines",
"DESCRIPTION:Every\\nwhere ! Yes\\, yes !",
"LOCATION:Here\\; too",
"UID:empty-uid"))
self.assertEqual(set(output[1:-1]), eq)