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


Python Logger.logWarning方法代码示例

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


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

示例1: __retrieveChannels__

# 需要导入模块: from common import Logger [as 别名]
# 或者: from common.Logger import logWarning [as 别名]
def __retrieveChannels__(tvChannels, dtUrl, channelType):
    contentDiv = BeautifulSoup.SoupStrainer('div', {'class':re.compile(r'\bhentry\b')})
    soup = HttpClient().getBeautifulSoup(url=dtUrl, parseOnlyThese=contentDiv)
    for tvChannelTag in soup.div.findAll('div', recursive=False):
        try:
            tvChannel = {}
            running_tvshows = []
            finished_tvshows = []
            tmp_tvshows_list = None
            firstRow = False
            for tag in tvChannelTag.findAll(re.compile('div|a'), recursive=False):
                if tag.name == 'div' and tag.get('class') == 'nav_up':
                    continue
                if not firstRow:
                    channelImg = ''
                    if(tag.find('img').has_key('src')):
                        channelImg = str(tag.find('img')['src'])
                    else:
                        channelImg = str(tag.find('img')['file'])
                    channelName = re.compile(BASE_WSITE_URL + '/category/(tv-serials|pakistan-tvs)/(.+?)/').findall(str(tag.find('a')['href']))[0][1]
                    channelName = string.upper(channelName.replace('-', ' '))
                    Logger.logDebug(channelName)
                    tvChannels[channelName] = tvChannel
                    tvChannel['iconimage'] = channelImg
                    tvChannel['channelType'] = channelType
                    firstRow = True
                else:
                    if tag.name == 'div' and tag.get('class') == 'dtLink':
                        txt = tag.getText()
                        Logger.logDebug(txt)
                        if re.search('running', txt, flags=re.IGNORECASE):
                            tmp_tvshows_list = running_tvshows
                            tvChannel['running_tvshows'] = running_tvshows
                        elif re.search('finished', txt, flags=re.IGNORECASE):
                            tmp_tvshows_list = finished_tvshows
                            tvChannel['finished_tvshows'] = finished_tvshows
                        else:
                            Logger.logWarning('UNKNOWN TV SHOW CATEGORY')
                    elif tag.name == 'a':
                        tvshowUrl = str(tag['href'])
                        tvshowName = tag.getText().encode('utf-8')
                        Logger.logDebug(tvshowName)
                        tmp_tvshows_list.append({'name':HttpUtils.unescape(tvshowName), 'url':tvshowUrl})
        except Exception, e:
            Logger.logFatal(e)
            Logger.logDebug(tvChannelTag)
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:48,代码来源:DT_TVShows.py

示例2: ListItem

# 需要导入模块: from common import Logger [as 别名]
# 或者: from common.Logger import logWarning [as 别名]
                 video_link['videoSourceImg'] = video_hosting_info.get_video_hosting_image()
                 video_link['videoSourceName'] = video_hosting_info.get_video_hosting_name()
             video_playlist_items.append(video_link)
             video_source_img = video_link['videoSourceImg']
             video_source_name = video_link['videoSourceName']
             
             item = ListItem()
             item.add_request_data('videoLink', video_link['videoLink'])
             item.add_request_data('videoTitle', video_link['videoTitle'])
             item.set_next_action_name('SnapAndPlayVideo')
             xbmcListItem = xbmcgui.ListItem(label='Source #' + str(video_source_id) + ' | ' + 'Part #' + str(video_part_index) , iconImage=video_source_img, thumbnailImage=video_source_img)
             item.set_xbmc_list_item_obj(xbmcListItem)
             response_obj.addListItem(item)
             prevAFont = child.findChild('font')
         except:
             Logger.logWarning('Unable to recognize a source = ' + str(video_link['videoLink']))
             video_source_img = None
             video_source_name = None
             video_part_index = 0
             video_playlist_items = []
             ignoreAllLinks = True
             prevAFont = None
     prevChild = child.name
 if len(video_playlist_items) > 0:
     response_obj.addListItem(__preparePlayListItem__(video_source_id, video_source_img, video_source_name, video_playlist_items))
     
 
 ''' Following new cool stuff is to get Smart Direct Play Feature'''
 playNowItem = __findPlayNowStream__(response_obj.get_item_list())
 if playNowItem is not None:
     request_obj.set_data({'videoPlayListItems': playNowItem.get_request_data()['videoPlayListItems']})
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:33,代码来源:DR_TVShows.py


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