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


Python Logger.logDebug方法代码示例

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


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

示例1: isVideoHostedByYou

# 需要导入模块: from common import Logger [as 别名]
# 或者: from common.Logger import logDebug [as 别名]
 def isVideoHostedByYou(self, video_url):
     isVideoHoster = False
     videoId = self.getVideoId(video_url)
     if videoId is not None:
         Logger.logDebug('Snapper selected = ' + self.getModuleName() + ' for video URL = ' + video_url)
         isVideoHoster = True
     return isVideoHoster
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:9,代码来源:SnapVideo.py

示例2: getVideoInfo

# 需要导入模块: from common import Logger [as 别名]
# 或者: from common.Logger import logDebug [as 别名]
 def getVideoInfo(self, video_url):
     videoInfo = None
     videoId = self.getVideoId(video_url)
     if videoId is not None:
         Logger.logDebug('Snapper selected = ' + self.getModuleName() + ' for video URL = ' + video_url)
         videoInfo = self.__getVideoInfo(videoId)
     return videoInfo
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:9,代码来源:SnapVideo.py

示例3: __addMovieInfo_in_item

# 需要导入模块: from common import Logger [as 别名]
# 或者: from common.Logger import logDebug [as 别名]
def __addMovieInfo_in_item(item):
    if item.get_next_action_name() == 'Movie_Streams':
        year = unicode(item.get_moving_data()['movieYear'], errors='ignore').encode('utf-8')
        title = unicode(item.get_moving_data()['movieTitle'], errors='ignore').encode('utf-8')
        meta = None
        try:
            global __metaget__
            if __metaget__ is None:
                __metaget__ = metahandlers.MetaData()
            meta = __metaget__.get_meta('movie', title, year=year)
        except:
            Logger.logDebug('Failed to load metahandler module')
        xbmc_item = item.get_xbmc_list_item_obj()
        
        if(meta is not None):
            xbmc_item.setIconImage(meta['thumb_url'])
            xbmc_item.setThumbnailImage(meta['cover_url'])
            videoInfo = {'trailer_url':meta['trailer_url']}
            for key, value in meta.items():
                if type(value) is str:
                    value = unicode(value).encode('utf-8')
                videoInfo[key] = value
            xbmc_item.setInfo('video', videoInfo)
            xbmc_item.setProperty('fanart_image', meta['backdrop_url'])
            item.add_request_data('videoInfo', videoInfo)
            
            contextMenuItems = []
            contextMenuItems.append(('Movie Information', 'XBMC.Action(Info)'))
            xbmc_item.addContextMenuItems(contextMenuItems, replaceItems=False)
        else:
            xbmc_item.setInfo('video', {'title':title, 'year':year})
            item.add_request_data('videoInfo', {'title':title, 'year':year})
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:34,代码来源:Metadata.py

示例4: callBackDialogProgressBar

# 需要导入模块: from common import Logger [as 别名]
# 或者: from common.Logger import logDebug [as 别名]
def callBackDialogProgressBar(function_obj, function_args, heading, failure_message=None, line1='Please wait...', line2='Retrieved $current_index of $total_it items', line3='To go back, press the Cancel button'):
    total_iteration = len(function_args)
    current_index = 0
    ProgressDisplayer().end()
    pDialog = None
    if not SUPPRESS_DIALOG_MSG:
        pDialog = xbmcgui.DialogProgress()
        pDialog.create(heading, line1, line2.replace('$total_it', str(total_iteration)).replace('$current_index', str(current_index)), line3)
        pDialog.update(1)
    Logger.logDebug('Total Iterations = ' + str(total_iteration))
    function_returns = []
    isCanceled = False
    for arg in function_args:
        try:
            returnedObj = function_obj(arg)
            if returnedObj is not None and type(returnedObj) is list:
                function_returns.extend(returnedObj)
            elif returnedObj is not None:
                function_returns.append(returnedObj)
            if not SUPPRESS_DIALOG_MSG and pDialog is not None:
                current_index = current_index + 1
                percent = (current_index * 100) / total_iteration
                pDialog.update(percent, line1, line2.replace('$total_it', str(total_iteration)).replace('$current_index', str(current_index)), line3)
                if (pDialog.iscanceled()):
                    isCanceled = True
                    break
        except Exception, e:
            if not SUPPRESS_DIALOG_MSG and pDialog is not None and failure_message is not None:
                pDialog.close()
                dialog = xbmcgui.Dialog()
                dialog.ok('[B][COLOR red]FAILED: [/COLOR][/B]Info Retrieval Process', failure_message, 'You may like to try again later or use other source if available')
            Logger.logFatal(e)
            raise Exception(ExceptionHandler.DONOT_DISPLAY_ERROR, '')
        if isCanceled:
            raise Exception(ExceptionHandler.PROCESS_STOPPED, 'It looks like you don\'t want wait more|Process was stopped in between')
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:37,代码来源:XBMCInterfaceUtils.py

示例5: retrieveVideoLinks

# 需要导入模块: from common import Logger [as 别名]
# 或者: from common.Logger import logDebug [as 别名]
def retrieveVideoLinks(request_obj, response_obj):
    video_source_id = 1
    video_source_img = None
    video_source_name = None
    video_part_index = 0
    video_playlist_items = []
    ignoreAllLinks = False
    
    content = BeautifulSoup.SoupStrainer('blockquote', {'class':re.compile(r'\bpostcontent\b')})
    soup = HttpClient().getBeautifulSoup(url=request_obj.get_data()['episodeUrl'], parseOnlyThese=content)
    for e in soup.findAll('br'):
        e.extract()
    Logger.logDebug(soup)
    if soup.has_key('div'):
        soup = soup.findChild('div', recursive=False)
    prevChild = ''
    prevAFont = None
    for child in soup.findChildren():
        if (child.name == 'img' or child.name == 'b' or (child.name == 'font' and not child.findChild('a'))):
            if (child.name == 'b' and prevChild == 'a') or (child.name == 'font' and child == prevAFont):
                continue
            else:
                if len(video_playlist_items) > 0:
                    response_obj.addListItem(__preparePlayListItem__(video_source_id, video_source_img, video_source_name, video_playlist_items))
                if video_source_img is not None:
                    video_source_id = video_source_id + 1
                    video_source_img = None
                    video_source_name = None
                    video_part_index = 0
                    video_playlist_items = []
                ignoreAllLinks = False
        elif not ignoreAllLinks and child.name == 'a' and not re.search('multi', str(child['href']), re.IGNORECASE):
            video_part_index = video_part_index + 1
            video_link = {}
            video_link['videoTitle'] = 'Source #' + str(video_source_id) + ' | ' + 'Part #' + str(video_part_index) + ' | ' + child.getText()
            video_link['videoLink'] = str(child['href'])
            try:
                try:
                    __prepareVideoLink__(video_link)
                except Exception, e:
                    Logger.logFatal(e)
                    video_hosting_info = SnapVideo.findVideoHostingInfo(video_link['videoLink'])
                    if video_hosting_info is None or video_hosting_info.get_video_hosting_name() == 'UrlResolver by t0mm0':
                        raise
                    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:
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:61,代码来源:DR_TVShows.py

示例6: __retrieveChannelTVShows__

# 需要导入模块: from common import Logger [as 别名]
# 或者: from common.Logger import logDebug [as 别名]
def __retrieveChannelTVShows__(tvChannelObj):
    running_tvshows = []
    finished_tvshows = []
    try:
        running_tvshows = __retrieveTVShows__(tvChannelObj["running_tvshows_url"])
        if(len(running_tvshows) == 0):
            running_tvshows.append({"name":"ENTER TO VIEW :: This is the only easy way to view!", "url":BASE_WSITE_URL + tvChannelObj["running_tvshows_url"]})
    except Exception, e:
        Logger.logFatal(e)
        Logger.logDebug('Failed to load a channel... Continue retrieval of next tv show')
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:12,代码来源:DR_TVShows.py

示例7: __send_request_to_google_analytics

# 需要导入模块: from common import Logger [as 别名]
# 或者: from common.Logger import logDebug [as 别名]
 def __send_request_to_google_analytics(self, utm_url):
     ua = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
     import urllib2
     try:
         if self.addon_context.addon.getSetting('ga_enabled') == 'true': #default is disabled
             req = urllib2.Request(utm_url, None, {'User-Agent':ua})
             response = urllib2.urlopen(req)
             print response.read()
             response.close()
     except Exception, e:
         Logger.logError(e)
         Logger.logDebug ("GA fail: %s" % utm_url)
开发者ID:msports,项目名称:mw,代码行数:14,代码来源:GoogleAnalytics.py

示例8: __initializeSnappers

# 需要导入模块: from common import Logger [as 别名]
# 或者: from common.Logger import logDebug [as 别名]
def __initializeSnappers():
    snapper_filepath = AddonUtils.getCompleteFilePath(Container().getAddonContext().addonPath, 'snapvideo', 'snappers.xml')
    if not AddonUtils.doesFileExist(snapper_filepath):
        snapper_filepath = AddonUtils.getCompleteFilePath(Container().getAddonContext().turtle_addonPath, 'lib/snapvideo', 'snappers.xml')
    global snappers
    if snappers is not None:
        return snappers
    snappers = []
    Logger.logDebug('Loading snappers.xml from path... ' + snapper_filepath)
    snappers_xml = AddonUtils.getBeautifulSoupObj(snapper_filepath)
    for snapperTag in snappers_xml.findAll('snapper', attrs={'enabled':'true'}):
        snappers.append(Snapper(snapperTag))
    return snappers
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:15,代码来源:SnapVideo.py

示例9: start

# 需要导入模块: from common import Logger [as 别名]
# 或者: from common.Logger import logDebug [as 别名]
def start(addon_id, addon_ver=None):
    try:
        Logger.logDebug(sys.argv)
        global __addon_id__
        __addon_id__ = addon_id
        __addon_ver__ = addon_ver
        
        containerObj = Container(addon_id=addon_id, addon_ver=addon_ver)
        action_id = containerObj.getTurtleRequest().get_action_id()
        containerObj.performAction(action_id)
    except urllib2.URLError, e:
        Logger.logFatal(e)
        XBMCInterfaceUtils.displayDialogMessage('Unable to connect', 'Please choose a different source if available in add-on.', 'Website used in add-on is down, try to access using web browser.', 'Please share logs with developer if problem keeps coming!')
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:15,代码来源:TurtlePlugin.py

示例10: __init__

# 需要导入模块: from common import Logger [as 别名]
# 或者: from common.Logger import logDebug [as 别名]
 def __init__(self, params=None):
     Logger.logDebug(params)
     self.set_action_id('__start__')
     if params is None:
         self.set_params({})
     elif type(params) is str:
         self.set_params(HttpUtils.getUrlParams(params))
     elif type(params) is dict:
         self.set_params(params)
     if self.get_params().has_key('actionId') and self.get_params()['actionId'] != '':
         self.set_action_id(self.get_params()['actionId'])
     if self.get_params().has_key('data') and self.get_params()['data'] != '':
         self.set_data(AddonUtils.decodeData(self.get_params()['data']))
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:15,代码来源:DataObjects.py

示例11: retrieveAudioInfo

# 需要导入模块: from common import Logger [as 别名]
# 或者: from common.Logger import logDebug [as 别名]
def retrieveAudioInfo(audioUrl):
    url = 'https://api.soundcloud.com/' + audioUrl
    jObj = json.loads(HttpUtils.HttpClient().getHtmlContent(url=url))
    
    video_info = VideoInfo()
    video_info.set_video_hosting_info(getVideoHostingInfo())
    video_info.set_video_id(url)
    video_info.add_video_link(VIDEO_QUAL_SD, jObj['http_mp3_128_url'], addUserAgent=False, addReferer=False)
    video_info.set_video_image('')
    video_info.set_video_name('')
    
    Logger.logDebug(jObj['http_mp3_128_url'])
    video_info.set_video_stopped(False)
    return video_info
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:16,代码来源:SoundCloud.py

示例12: playZappyVideo

# 需要导入模块: from common import Logger [as 别名]
# 或者: from common.Logger import logDebug [as 别名]
def playZappyVideo(request_obj, response_obj):
    Logger.logDebug(request_obj.get_data());
    Container().ga_client.reportAction('zappyvideo')
    video_id = request_obj.get_data()['videoId']
    port = request_obj.get_data()['port']
    ipaddress = request_obj.get_data()['client_ip']
    video_url = "http://" + ipaddress + ":" + str(port) + "/?videoId=" + video_id
    item = ListItem()
    item.get_moving_data()['videoStreamUrl'] = video_url
    item.set_next_action_name('Play')
    xbmcListItem = xbmcgui.ListItem(label='Streaming Video')
    item.set_xbmc_list_item_obj(xbmcListItem)
    response_obj.addListItem(item)
    response_obj.addServiceResponseParam("status", "success")
    response_obj.addServiceResponseParam("message", "Enjoy the video!")
开发者ID:shauryaanand,项目名称:desimc,代码行数:17,代码来源:PlayIt_Moves.py

示例13: retrieveVideoInfo

# 需要导入模块: from common import Logger [as 别名]
# 或者: from common.Logger import logDebug [as 别名]
def retrieveVideoInfo(videoUrl):
    try: 
        xbmcaddon.Addon('plugin.video.vevo')
    except: 
        dialog = xbmcgui.Dialog()
        dialog.ok('[B][COLOR red]MISSING: [/COLOR][/B] VEVO add-on', '', 'Please install VEVO add-on created by BlueCop!', 'Available at http://code.google.com/p/bluecop-xbmc-repo/')
        raise
    video_info = VideoInfo()
    video_info.set_video_hosting_info(getVideoHostingInfo())
    video_info.set_video_id(videoUrl)
    addon_url = 'plugin://plugin.video.vevo/?'
    vevo_id = videoUrl.split('/')[-1]
    if videoUrl.startswith('playlist'):
        url = urllib.quote_plus('http://api.vevo.com/mobile/v2/playlist/%s.json?' % vevo_id)
        addon_url += 'url=%s' % url
        addon_url += '&mode=playPlaylist'
        addon_url += '&duration=210'
        addon_url += '&page=1'
        video_info.add_video_link(XBMC_EXECUTE_PLUGIN, addon_url, addUserAgent=False, addReferer=False)
        video_info.set_video_image('')
        video_info.set_video_name(' ')
    else:
        url = 'http://videoplayer.vevo.com/VideoService/AuthenticateVideo?isrc=%s&extended=true' % vevo_id
        video = json.loads(HttpUtils.HttpClient().getHtmlContent(url=url))['video']
        title = ''
        try:title = video['title'].encode('utf-8')
        except: title = ''                  
        video_image = video['imageUrl']
        if len(video['featuredArtists']) > 0:
            feats = ''
            for featuredartist in video['featuredArtists']:
                # featuredartist_image = featuredartist['image_url']
                featuredartist_name = featuredartist['artistName'].encode('utf-8')
                feats += featuredartist_name + ', '
            feats = feats[:-2]
            title += ' (ft. ' + feats + ')'
                
        addon_url += 'url=%s' % vevo_id
        addon_url += '&mode=playVideo'
        addon_url += '&duration=210'
        video_info.add_video_link(VIDEO_QUAL_SD, addon_url, addUserAgent=False, addReferer=False)
        video_info.set_video_image(video_image)
        video_info.set_video_name(title)
    
    Logger.logDebug(addon_url)
    video_info.set_video_stopped(False)
    return video_info
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:49,代码来源:VevoDelegator.py

示例14: retrievePakVideoLinks

# 需要导入模块: from common import Logger [as 别名]
# 或者: from common.Logger import logDebug [as 别名]
def retrievePakVideoLinks(request_obj, response_obj):
    video_source_id = 0
    video_source_img = None
    video_part_index = 0
    video_playlist_items = []
    html = HttpClient().getHtmlContent(url=request_obj.get_data()['episodeUrl'])
    videoFrameTags = re.compile('<iframe class\="(youtube|dailymotion)\-player" (.+?)src\="(.+?)"').findall(html)
    Logger.logDebug(videoFrameTags)
    for frameTagType, extra, videoLink in videoFrameTags:
        source_img = None
        if frameTagType == 'youtube':
            source_img = 'http://www.automotivefinancingsystems.com/images/icons/socialmedia_youtube_256x256.png'
        elif frameTagType == 'dailymotion':
            source_img = 'http://press.dailymotion.com/fr/wp-content/uploads/logo-Dailymotion.png'
            
        if video_source_img is None or video_source_img != source_img:
            if len(video_playlist_items) > 0:
                response_obj.addListItem(__preparePlayListItem__(video_source_id, video_source_img, video_playlist_items))
            video_source_id = video_source_id + 1
            video_source_img = source_img
            video_part_index = 0
            video_playlist_items = []
            
        video_part_index = video_part_index + 1
        video_link = {}
        video_link['videoTitle'] = 'Source #' + str(video_source_id) + ' | ' + 'Part #' + str(video_part_index)
        video_link['videoLink'] = videoLink
        video_playlist_items.append(video_link)
        
        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)
            
    if len(video_playlist_items) > 0:
        response_obj.addListItem(__preparePlayListItem__(video_source_id, video_source_img, video_playlist_items))
        
    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,代码行数:45,代码来源:DT_TVShows.py

示例15: __init__

# 需要导入模块: from common import Logger [as 别名]
# 或者: from common.Logger import logDebug [as 别名]
 def __init__(self, snapper_Tag):
     modulePath = snapper_Tag['module']
     functionName = snapper_Tag['function']
     self.__video_id_regex_list = []
     for videoIdTag in snapper_Tag.findAll('video-id'):
         self.__video_id_regex_list.append(videoIdTag['regex'])
     self.__is_playlist = False
     if snapper_Tag.has_key('playlist') and snapper_Tag['playlist'] == 'true':
         self.__is_playlist = True
     components = modulePath.split('.')
     module = __import__(modulePath)
     if components is not None and isinstance(components, list):
         for index in range(1, len(components)):
             module = getattr(module, components[index])
     
     self.__snapper_module = module
     self.__snapper_modulepath = modulePath + ':' + functionName
     self.__getVideoInfo = getattr(module, functionName)
     self.getVideoHostingInfo = getattr(module, 'getVideoHostingInfo')
     Logger.logDebug('Snapper loaded = ' + modulePath)
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:22,代码来源:SnapVideo.py


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