本文整理汇总了Python中tracim.model.data.Content.properties方法的典型用法代码示例。如果您正苦于以下问题:Python Content.properties方法的具体用法?Python Content.properties怎么用?Python Content.properties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tracim.model.data.Content
的用法示例。
在下文中一共展示了Content.properties方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_allowed_content
# 需要导入模块: from tracim.model.data import Content [as 别名]
# 或者: from tracim.model.data.Content import properties [as 别名]
def set_allowed_content(self, folder: Content, allowed_content_dict:dict):
"""
:param folder: the given folder instance
:param allowed_content_dict: must be something like this:
dict(
folder = True
thread = True,
file = False,
page = True
)
:return:
"""
properties = dict(allowed_content = allowed_content_dict)
folder.properties = properties
示例2: populate_content_with_event
# 需要导入模块: from tracim.model.data import Content [as 别名]
# 或者: from tracim.model.data.Content import properties [as 别名]
def populate_content_with_event(
self,
content: Content,
event: iCalendarEvent,
event_name: str,
) -> None:
"""
Populate Content content instance from iCalendarEvent event attributes.
:param content: content to populate
:param event: event with data to insert in content
:param event_name: Event name (ID) like
20160602T083511Z-18100-1001-1-71_Bastien-20160602T083516Z.ics
:return: given content
"""
content.label = event.get('summary')
content.description = event.get('description')
content.properties = {
'name': event_name,
'location': event.get('location'),
'raw': event.to_ical().decode("utf-8"),
'start': event.get('dtend').dt.strftime('%Y-%m-%d %H:%M:%S%z'),
'end': event.get('dtstart').dt.strftime('%Y-%m-%d %H:%M:%S%z'),
}