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


Python Event.content方法代码示例

本文整理汇总了Python中models.Event.content方法的典型用法代码示例。如果您正苦于以下问题:Python Event.content方法的具体用法?Python Event.content怎么用?Python Event.content使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.Event的用法示例。


在下文中一共展示了Event.content方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: make_event

# 需要导入模块: from models import Event [as 别名]
# 或者: from models.Event import content [as 别名]
 def make_event(self, entry):
     event = Event()
     event.type = self.type
     event.title = entry.title
     event.uid = entry.id
     event.url = entry.link
     event.created = time.mktime(entry.updated_parsed)
     event.author = entry.get("author", "unknown")
     if entry.has_key("content"):
         event.content = entry.content[0].value
     elif entry.has_key("summary"):
         event.content = entry.summary
     else:
         event.content = ""
     self.post_init(event, entry)
     return event
开发者ID:tsoulcie,项目名称:nuxeo.org,代码行数:18,代码来源:plugins.py

示例2: convert_to_entity

# 需要导入模块: from models import Event [as 别名]
# 或者: from models.Event import content [as 别名]
def convert_to_entity(vevent):
#     print vevent
    event_key = get_key(find_pattern(uid_pattern, vevent))
    event = Event(key=event_key)
    event.title = find_pattern(summary_pattern, vevent)
    event.content = find_pattern(content_pattern, vevent).replace('\r\n ', '')
    date = find_pattern(time_added_pattern, vevent) # 20150527T131225Z
    event.location = find_pattern(location_pattern, vevent)
    event.time_added = datetime.strptime(date, '%Y%m%dT%H%M%SZ')
    time = find_pattern(start_time_pattern, vevent) # 20150528T190000Z
    event.start_time = datetime.strptime(time, '%Y%m%dT%H%M%SZ')
    time = find_pattern(end_time_pattern, vevent) # 20150528T190000Z
    event.end_time = datetime.strptime(time, '%Y%m%dT%H%M%SZ')
    repeat = find_pattern(repeat_pattern, vevent)
    until = find_pattern(until_pattern, vevent, 2)
    seperator = ""
    if until is not None:
        seperator = ":"
    event.repeat = to_string(repeat) + seperator + to_string(until)
    return event
开发者ID:aapteedea,项目名称:shiloh-ranch,代码行数:22,代码来源:events.py


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