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


Python Timeline.start_timeline方法代码示例

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


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

示例1: new_timeline

# 需要导入模块: from timeline import Timeline [as 别名]
# 或者: from timeline.Timeline import start_timeline [as 别名]
 def new_timeline(self, label, method, userstream = False, *args, **kwargs):
     # Create Timeline Object
     tl = Timeline()
     
     if method == "filter":
         if self.get_filter_tab():
             # filter method only one connection
             self.message_dialog(
                 "May create only one standing connection to the Streaming API.\n"
                 "Please close existing Streaming API tab if you want.")
             tl.destroy()
             return
         
         # set Streaming API stream
         tl.set_stream("filter", kwargs)
     else:
         interval = self.get_default_interval(method)        
         tl.set_timeline(method, interval, self.scounts, args, kwargs)
         # Put error to statubar
         tl.timeline.on_twitterapi_error = self.on_twitterapi_error
     
     # for Event
     tl.view.new_timeline = self.new_timeline
     
     # Add Notebook (Tab view)
     uid = self.new_tab(tl, label, tl, kwargs.get("deny_close", False))
     if method == "filter": self.set_filter_tab(uid)
     
     # Set color
     tl.view.set_color(self.status_color)
     
     if method == "mentions":
         # memory mentions tab_id
         self.timeline_mention = uid
         tl.on_status_added = self.on_mentions_added
     else:
         tl.on_status_added = self.on_status_added
     
     # Put tweet information to statusbar
     tl.view.on_status_selection_changed = self.on_status_selection_changed
     # Reply on double click
     tl.view.on_status_activated = self.on_status_activated
    
     # Set UserStream parameter
     if userstream:
         tl.set_stream("user")
     
     tl.start_stream()
     tl.start_timeline()
开发者ID:techno,项目名称:gwit,代码行数:51,代码来源:main.py


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