本文整理汇总了Python中stream.Stream.start方法的典型用法代码示例。如果您正苦于以下问题:Python Stream.start方法的具体用法?Python Stream.start怎么用?Python Stream.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stream.Stream
的用法示例。
在下文中一共展示了Stream.start方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from stream import Stream [as 别名]
# 或者: from stream.Stream import start [as 别名]
def main(argv):
if len(argv) < 2:
print("usage: python server.py [port]")
return 1
port = int(argv[1])
stream = Stream(port)
stream.accept_incoming_connections()
stream.start()
示例2: select_stream_from_entry
# 需要导入模块: from stream import Stream [as 别名]
# 或者: from stream.Stream import start [as 别名]
def select_stream_from_entry( self ):
"""
Gets the values from the ui elements, and executes the program in json mode, to determine if the values are valid
"""
url = self.get_complete_url()
split_url = url.split()
self.messages_ui.append( 'Trying to open stream: {}'.format( url ) )
stream = Stream( split_url )
stream.start( self.messages_ui )
示例3: select_stream_from_link
# 需要导入模块: from stream import Stream [as 别名]
# 或者: from stream.Stream import start [as 别名]
def select_stream_from_link( self, tableWidgetItem ):
row = tableWidgetItem.row()
urlItem = self.links_ui.item( row, 0 ) # the url is in the first column
url = urlItem.text()
split_url = url.split()
self.messages_ui.append( 'Trying to open stream: {}'.format( url ) )
stream = Stream( split_url )
stream.start( self.messages_ui )
示例4: main
# 需要导入模块: from stream import Stream [as 别名]
# 或者: from stream.Stream import start [as 别名]
def main():
# If all else fails,
socket.setdefaulttimeout(60)
sys.stderr.write("Griffonbot starting up...\n")
log = Log(config.log)
log.debug("Main: Setting up...")
bot = IRCBot(config.irc, log)
if config.twitter.enable:
stream = Stream(config.twitter, bot.queue_message, log)
if config.mail.enable:
mail = Mail(config.mail, bot.queue_message, log)
if config.stdin.enable:
stdin = Stdin(config.stdin, bot.queue_message, log)
log.info("Main: Starting...")
bot.start()
if config.twitter.enable:
stream.start()
if config.mail.enable:
mail.start()
if config.stdin.enable:
stdin.start()
log.debug("Main: Now waiting...")
wait()
log.notice("Dead: Exiting...")
sys.exit(1)