本文整理汇总了Python中Channel.getStreamUrlTemplates方法的典型用法代码示例。如果您正苦于以下问题:Python Channel.getStreamUrlTemplates方法的具体用法?Python Channel.getStreamUrlTemplates怎么用?Python Channel.getStreamUrlTemplates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Channel
的用法示例。
在下文中一共展示了Channel.getStreamUrlTemplates方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: InsertChannelCallback
# 需要导入模块: import Channel [as 别名]
# 或者: from Channel import getStreamUrlTemplates [as 别名]
def InsertChannelCallback( sender, query ):
Log( "InsertChannelCallback ..." )
# For testing by reducing url typing
if FAST_MY_CHANNEL_ENTRY:
# query = "hdhomerun://DEVICE-0/tuner0?channel=8vsb:999999&program=%s" % query
query = "hdhomerun://DEVICE-0/ch24-%s" % query
try:
myChannel = Channel.fromUrl( query )
if not myChannel:
deviceId = Prefs[DEVICE_ID]
tunerId = Prefs[TUNER_ID]
return MessageContainer(
L('Error'),
"%s\n%s" % ( L('BadStreamUrl'),
"\n".join( Channel.getStreamUrlTemplates(deviceId, tunerId)))
)
# default channel to verfied and enabled
myChannel.GuideName = L('MyChannel')
myChannel.Verified = True
myChannel.Enabled = True
myLineupList = NewMyLineupList( myChannel )
UpdateLineupList( myLineupList )
return MessageContainer(
L('Success'),
"%s: %s" % ( L('Added'), myChannel.toString() )
)
except Exception, e:
Log( "Exception: %s" % e, False )
return MessageContainer(
L('Error'),
"%s: %s" % ( L('ProblemInsertingChannel'), query )
)