当前位置: 首页>>代码示例>>Python>>正文


Python Content.properties方法代码示例

本文整理汇总了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
开发者ID:buxx,项目名称:tracim,代码行数:16,代码来源:content.py

示例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'),
     }
开发者ID:buxx,项目名称:tracim,代码行数:25,代码来源:calendar.py


注:本文中的tracim.model.data.Content.properties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。