• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python utils.log函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中resources.lib.utils.log函数的典型用法代码示例。如果您正苦于以下问题:Python log函数的具体用法?Python log怎么用?Python log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: _daemon

def _daemon():
    previous_getDVDState = 4 # this should insure only on rip is done
    while ( not xbmc.abortRequested ):
        xbmc.sleep( 250 )
        if xbmc.getDVDState() == 4 and previous_getDVDState != 4:
            utils.log( "Disc Detected, Checking for Movie Disc(s)", xbmc.LOGNOTICE )
            xbmc.sleep( 3000 )
            previous_getDVDState = xbmc.getDVDState()
            disc = makemkv.makeMKV( general_settings ).findDisc( general_settings[ "temp_folder" ] )
            if disc:
                utils.log( "Movie Disc Detected", xbmc.LOGNOTICE )
                if general_settings[ "movie_disc_insertion" ] == "Rip":
                    makeMKV().rip( disc )
                elif general_settings[ "movie_disc_insertion" ] == "Notify":
                    pass
                elif general_settings[ "movie_disc_insertion" ] == "Stream":
                    pass
                elif general_settings[ "movie_disc_insertion" ] == "Ask":
                    pass
                elif general_settings[ "movie_disc_insertion" ] == "Backup":
                    pass
                else: #do nothing
                    pass
        elif xbmc.getDVDState() !=4:
            previous_getDVDState = xbmc.getDVDState()
开发者ID:Giftie,项目名称:service.makemkv.rip,代码行数:25,代码来源:service.py


示例2: get_image_list

 def get_image_list(self, media_id):
     data = get_json(self.url %(media_id, self.api_key))
     image_list = []
     # Get fanart
     try:
         for item in data['backdrops']:
             info = {}
             info['url'] = self.imageurl + 'original' + item['file_path']    # Original image url
             info['preview'] = self.imageurl + 'w300' + item['file_path']    # Create a preview url for later use
             info['id'] = item['file_path'].lstrip('/').replace('.jpg', '')  # Strip filename to get an ID
             info['type'] = ['fanart','extrafanart']                         # Set standard to 'fanart'
             info['height'] = item['height']
             info['width'] = item['width']
             #info['aspect_ratio'] = item['aspect_ratio']                    # Who knows when we may need it
             # Convert the 'None' value to default 'n/a'
             if item['iso_639_1']:
                 info['language'] = item['iso_639_1']
             else:
                 info['language'] = 'n/a'
             info['rating'] = 'n/a'                                          # Rating may be integrated at later time
             # Create Gui string to display
             info['generalinfo'] = 'Language: %s  |  Rating: %s  |  Size: %sx%s   ' %(info['language'], info['rating'], info['width'],info['height'])
             if info:
                 image_list.append(info)
     except Exception, e:
         log( str( e ), xbmc.LOGNOTICE )
开发者ID:cienislaw,项目名称:script.artwork.downloader,代码行数:26,代码来源:tmdb.py


示例3: getAllEventsAndPromotions

def getAllEventsAndPromotions():
    log('Retrieving details of all eventIDs from database')
    with storageDB:
        cur = storageDB.cursor()
        cur.execute("SELECT DISTINCT eventID FROM events UNION SELECT DISTINCT promotion FROM events")
        result = cur.fetchall()
    return result
开发者ID:jasonh-n-austin,项目名称:plugin.video.mmabrowser,代码行数:7,代码来源:databaseops.py


示例4: get_image_list

 def get_image_list(self, media_id):
     xml_url = self.url % (self.api_key,media_id)
     log('API: %s ' % xml_url)
     image_list = []
     data = get_xml(xml_url)
     tree = ET.fromstring(data)
     for imagetype in self.imagetypes:
         imageroot = imagetype + 's'
         for images in tree.findall(imageroot):
             for image in images:
                 info = {}
                 info['id'] = image.get('id')
                 info['url'] = urllib.quote(image.get('url'), ':/')
                 info['preview'] = urllib.quote(image.get('preview'), ':/')
                 info['type'] = imagetype
                 info['language'] = image.get('lang')
                 info['likes'] = image.get('likes')
                 # Create Gui string to display
                 info['generalinfo'] = '%s: %s  |  %s: %s   ' %( __localize__(32141), info['language'], __localize__(32143), info['likes'] )
                 if info:            
                     image_list.append(info)
     if image_list == []:
         raise NoFanartError(media_id)
     else:
         return image_list
开发者ID:CutSickAss,项目名称:script.artwork.downloader,代码行数:25,代码来源:fanarttv.py


示例5: __init__

    def __init__(self):
        self.monitor = UpdateMonitor(update_method = self.settingsChanged)
        self.enabled = utils.getSetting("enable_scheduler")
        self.next_run_path = xbmc.translatePath(utils.data_dir()) + 'next_run.txt'

        if(self.enabled == "true"):

            nr = 0
            if(xbmcvfs.exists(self.next_run_path)):

                fh = xbmcvfs.File(self.next_run_path)
                try:
                    #check if we saved a run time from the last run
                    nr = float(fh.read())
                except ValueError:
                    nr = 0

                fh.close()

            #if we missed and the user wants to play catch-up
            if(0 < nr <= time.time() and utils.getSetting('schedule_miss') == 'true'):
                utils.log("scheduled backup was missed, doing it now...")
                progress_mode = int(utils.getSetting('progress_mode'))
                
                if(progress_mode == 0):
                    progress_mode = 1 # Kodi just started, don't block it with a foreground progress bar

                self.doScheduledBackup(progress_mode)
                
            self.setup()
开发者ID:robweber,项目名称:xbmcbackup,代码行数:30,代码来源:scheduler.py


示例6: get_image_list

 def get_image_list(self, media_id):
     xml_url = self.url % (self.api_key, media_id)
     log('API: %s ' % xml_url)
     image_list = []
     data = self.get_xml(xml_url)
     tree = ET.fromstring(data)
     for image in tree.findall('Banner'):
         info = {}
         if image.findtext('BannerType') == 'fanart' and image.findtext('BannerPath'):
             info['url'] = self.url_prefix + image.findtext('BannerPath')
             info['language'] = image.findtext('Language')
             if image.findtext('BannerType2'):
                 x,y = image.findtext('BannerType2').split('x')
                 info['height'] = int(x)
                 info['width'] = int(y)
             info['series_name'] = image.findtext('SeriesName') == 'true'
             if image.findtext('RatingCount') and int(image.findtext('RatingCount')) >= 1:
                 info['rating'] = float(image.findtext('Rating'))
             else:
                 info['rating'] = 0
         if info:            
             image_list.append(info) 
     if image_list == []:
         raise NoFanartError(media_id)
     else:
         return image_list
开发者ID:Giftie,项目名称:script.extrafanartdownloader,代码行数:26,代码来源:tvdb.py


示例7: getEventsByPromotion

def getEventsByPromotion(promotion):
    log('Retrieving details of all events from database for promotion: %s' % promotion)
    with storageDB:
        cur = storageDB.cursor()
        cur.execute("SELECT eventID, title, promotion, date, venue, city FROM events WHERE promotion='%s' ORDER BY date" % promotion)
        result = cur.fetchall()
    return result
开发者ID:jasonh-n-austin,项目名称:plugin.video.mmabrowser,代码行数:7,代码来源:databaseops.py


示例8: md5sum_verified

 def md5sum_verified(self, md5sum_compare, path):
     if self.background:
         verify_progress = progress.ProgressBG()
     else:
         verify_progress = progress.Progress()
         
     verify_progress.create("Verifying", line2=path)
 
     BLOCK_SIZE = 8192
     
     hasher = hashlib.md5()
     f = open(path)
     
     done = 0
     size = os.path.getsize(path)
     while done < size:
         if verify_progress.iscanceled():
             verify_progress.close()
             return True
         data = f.read(BLOCK_SIZE)
         done += len(data)
         hasher.update(data)
         percent = int(done * 100 / size)
         verify_progress.update(percent)
     verify_progress.close()
         
     md5sum = hasher.hexdigest()
     utils.log("{} md5 hash = {}".format(path, md5sum))
     return md5sum == md5sum_compare
开发者ID:foXaCe,项目名称:script.openelec.devupdate,代码行数:29,代码来源:default.py


示例9: authorize

    def authorize(self):
        result = True

        if(not self.setup()):
            return False
        
        if(self.isAuthorized()):
            #delete the token to start over
            self._deleteToken()

        #copied flow from http://dropbox-sdk-python.readthedocs.io/en/latest/moduledoc.html#dropbox.oauth.DropboxOAuth2FlowNoRedirect
        flow = dropbox.oauth.DropboxOAuth2FlowNoRedirect(self.APP_KEY,self.APP_SECRET)

        url = flow.start()

        #print url in log
        utils.log("Authorize URL: " + url)
        xbmcgui.Dialog().ok(utils.getString(30010),utils.getString(30056),utils.getString(30057),tinyurl.shorten(url))

        #get the auth code
        code = xbmcgui.Dialog().input(utils.getString(30027) + ' ' + utils.getString(30103))
        
        #if user authorized this will work

        try:
            user_token = flow.finish(code)
            self._setToken(user_token.access_token)
        except Exception,e:
            utils.log("Error: %s" % (e,))
            result = False
开发者ID:robweber,项目名称:xbmcbackup,代码行数:30,代码来源:authorizers.py


示例10: getAllFighters

def getAllFighters():
    log('Retrieving details of all fighters from database')
    with storageDB:
        cur = storageDB.cursor()
        cur.execute("SELECT DISTINCT fighters.*, COUNT(*) AS cnt FROM fighters INNER JOIN fights ON (fights.fighter1=fighters.fighterID OR fights.fighter2=fighters.fighterID) GROUP BY fighters.fighterID ORDER BY fighters.name")
        result = cur.fetchall()
    return result
开发者ID:jasonh-n-austin,项目名称:plugin.video.mmabrowser,代码行数:7,代码来源:databaseops.py


示例11: getEventsByFighter

def getEventsByFighter(fighterID):
    log('Retrieving details of all events from database for fighter: %s' % fighterID)
    with storageDB:
        cur = storageDB.cursor()
        cur.execute("SELECT DISTINCT events.eventID, events.title, events.promotion, events.date, events.venue, events.city FROM events INNER JOIN fights ON events.eventID=fights.eventID WHERE (fighter1='%s' OR fighter2='%s') ORDER BY date" % (fighterID, fighterID))
        result = cur.fetchall()
    return result
开发者ID:jasonh-n-austin,项目名称:plugin.video.mmabrowser,代码行数:7,代码来源:databaseops.py


示例12: searchEvents

def searchEvents(searchStr):
    log("Searching database for events: %s" % searchStr)
    with storageDB:
        cur = storageDB.cursor()
        cur.execute("SELECT DISTINCT eventID, title, promotion, date, venue, city FROM events WHERE (eventID LIKE '%s' OR title LIKE '%s' OR promotion LIKE '%s' OR date LIKE '%s' OR venue LIKE '%s' OR city LIKE '%s') ORDER BY date" % ("%" + searchStr + "%", "%" + searchStr + "%", "%" + searchStr + "%", "%" + searchStr + "%", "%" + searchStr + "%", "%" + searchStr + "%"))
        result = cur.fetchall()
    return result
开发者ID:jasonh-n-austin,项目名称:plugin.video.mmabrowser,代码行数:7,代码来源:databaseops.py


示例13: searchFighters

def searchFighters(searchStr):
    log("Searching database for fighters: %s" % searchStr)
    with storageDB:
        cur = storageDB.cursor()
        cur.execute("SELECT DISTINCT fighters.*, COUNT(*) AS cnt FROM fighters INNER JOIN fights ON (fights.fighter1=fighters.fighterID OR fights.fighter2=fighters.fighterID) WHERE (fighters.fighterID LIKE '%s' OR fighters.name LIKE '%s' OR fighters.nickname LIKE '%s' OR fighters.association LIKE '%s' OR fighters.city LIKE '%s' OR fighters.country LIKE '%s') GROUP BY fighters.fighterID ORDER BY fighters.name" % ("%" + searchStr + "%", "%" + searchStr + "%", "%" + searchStr + "%", "%" + searchStr + "%", "%" + searchStr + "%", "%" + searchStr + "%"))
        result = cur.fetchall()
    return result
开发者ID:jasonh-n-austin,项目名称:plugin.video.mmabrowser,代码行数:7,代码来源:databaseops.py


示例14: getEventCount

def getEventCount(promotion):
    log('Retrieving count of events in database for promotion: %s' % promotion)
    with storageDB:
        cur = storageDB.cursor()
        cur.execute("SELECT COUNT(DISTINCT eventID) FROM events WHERE promotion='%s'" % promotion)
        result = cur.fetchone()
    return result[0]
开发者ID:jasonh-n-austin,项目名称:plugin.video.mmabrowser,代码行数:7,代码来源:databaseops.py


示例15: getEvent

def getEvent(eventID):
    log('Retrieving details of event from database: %s' % eventID)
    with storageDB:
        cur = storageDB.cursor()
        cur.execute("SELECT * FROM events WHERE eventID='%s'" % eventID)
        result = cur.fetchone()
    return result
开发者ID:jasonh-n-austin,项目名称:plugin.video.mmabrowser,代码行数:7,代码来源:databaseops.py


示例16: fetch_vids

def fetch_vids(filters={}, reset=False):
  post_data = {
    'serviceClassName': 'org.sesameworkshop.service.UmpServiceUtil',
    'serviceMethodName': 'getMediaItems',
    'serviceParameters': ['criteria','capabilities','resultsBiasingPolicy','context'],
    'criteria': {
      'qty': settings.listsVideonum,
      'reset': reset,
      'type': 'video',
      'filters': filters
    },
    'capabilities': {},
    'resultsBiasingPolicy': '',
    'context': {}
  }
  
  # check for age restriction
  if settings.filterAgegroup > 0:
    post_data['criteria']['filters']['age'] = settings.filterAgegroup
  
  utils.log(post_data)
  headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Cookie': session.getCookie()}
  req = urllib2.Request(common.sesame_base_url + '/c/portal/json_service', urllib.urlencode(post_data), headers)
  res = urllib2.urlopen(req)
  session.parseCookieHeaders(res)
  data = json.load(res)
  if len(data['content']) == 0:
    return False
  return data['content']
开发者ID:amitkeret,项目名称:plugin.video.sesame-street,代码行数:29,代码来源:default.py


示例17: getAllPromotions

def getAllPromotions():
    log('Retrieving list of all promotions from database')
    with storageDB:
        cur = storageDB.cursor()
        cur.execute("SELECT DISTINCT promotion FROM events ORDER BY promotion")
        result = cur.fetchall()
    return result
开发者ID:jasonh-n-austin,项目名称:plugin.video.mmabrowser,代码行数:7,代码来源:databaseops.py


示例18: getHtml

def getHtml(url):
    
    """
    Retrieve and return remote resource as string
    
    Arguments:
    url -- A string containing the url of a remote page to retrieve
    
    Returns:
    data -- A string containing the contents to the remote page
    """
    
    log('Retrieving url: %s' % url)

    # set default timeout
    socket.setdefaulttimeout(__defaultTimeout__)

    # connect to url using urlopen
    client = urlopen(url)
    
    # read data from page
    data = client.read()
    
    # close connection to url
    client.close()

    log('Retrieved url: %s' % url)

    # return the retrieved data
    return data
开发者ID:budswell,项目名称:plugin.video.mmabrowser,代码行数:30,代码来源:sherdog.py


示例19: getAllEvents

def getAllEvents():
    log('Retrieving details of all events from database')
    with storageDB:
        cur = storageDB.cursor()
        cur.execute("SELECT DISTINCT eventID, title, promotion, date, venue, city FROM events ORDER BY date")
        result = cur.fetchall()
    return result
开发者ID:jasonh-n-austin,项目名称:plugin.video.mmabrowser,代码行数:7,代码来源:databaseops.py


示例20: _gui_imagelist

 def _gui_imagelist(self, art_type):
     log('- Retrieving image list for GUI')
     filteredlist = []
     #retrieve list
     for artwork in self.image_list:
         if  art_type in artwork['type']:
             filteredlist.append(artwork)
     return filteredlist
开发者ID:CutSickAss,项目名称:script.artwork.downloader,代码行数:8,代码来源:default.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.notify函数代码示例发布时间:2022-05-26
下一篇:
Python utils.get_webcontent函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap