本文整理汇总了Python中service.Service.mimeGetProtocol方法的典型用法代码示例。如果您正苦于以下问题:Python Service.mimeGetProtocol方法的具体用法?Python Service.mimeGetProtocol怎么用?Python Service.mimeGetProtocol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类service.Service
的用法示例。
在下文中一共展示了Service.mimeGetProtocol方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: cmsGetProtocolInfo
# 需要导入模块: from service import Service [as 别名]
# 或者: from service.Service import mimeGetProtocol [as 别名]
def cmsGetProtocolInfo(event):
if not event:
return False
respText = ''
index = 0
for mimeType in mimeTypeList:
respText = respText + Service.mimeGetProtocol(mimeType)
index = index + 1
if index != len(mimeTypeList):
respText = respText + ","
Service.upnpAddResponse(event, CMSService.SERVICE_CMS_ARG_SOURCE, respText)
Service.upnpAddResponse(event, CMSService.SERVICE_CMS_ARG_SINK, '')
return event['status']
示例2: cmsGetCurrentConnectionInfo
# 需要导入模块: from service import Service [as 别名]
# 或者: from service.Service import mimeGetProtocol [as 别名]
def cmsGetCurrentConnectionInfo(event):
if not event:
return False
Service.upnpAddResponse(event, CMSService.SERVICE_CMS_ARG_CONNECTION_ID, CMSService.SERVICE_CMS_DEFAULT_CON_ID)
Service.upnpAddResponse(event, CMSService.SERVICE_CMS_ARG_RCS_ID, CMSService.SERVICE_CMS_UNKNOWN_ID)
Service.upnpAddResponse(event, CMSService.SERVICE_CMS_ARG_TRANSPORT_ID, CMSService.SERVICE_CMS_UNKNOWN_ID)
for i in range(len(mimeTypeList)):
mimeType = mimeTypeList[i]
protocol = Service.mimeGetProtocol(mimeType)
Service.upnpAddResponse(event, CMSService.SERVICE_CMS_ARG_PROT_INFO, protocol)
Service.upnpAddResponse(event, CMSService.SERVICE_CMS_ARG_PEER_CON_MANAGER, '')
Service.upnpAddResponse(event, CMSService.SERVICE_CMS_ARG_PEER_CON_ID, CMSService.SERVICE_CMS_UNKNOWN_ID)
Service.upnpAddResponse(event, CMSService.SERVICE_CMS_ARG_DIRECTION, CMSService.SERVICE_CMS_OUTPUT)
Service.upnpAddResponse(event, CMSService.SERVICE_CMS_ARG_STATUS, CMSService.SERVICE_CMS_STATUS_OK)
return event['status']