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


Python xbmc.LOGNOTICE属性代码示例

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


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

示例1: emit

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGNOTICE [as 别名]
def emit(self, record):

        if self._get_log_level(record.levelno):

            try:
                string = self.format(record)
            except Exception as error:
                xbmc.log("Error trying to format string for log", level=xbmc.LOGNOTICE)

                return

            if self.mask_info:
                for server in self.sensitive['Server']:
                    string = string.replace(server.encode('utf-8') or "{server}", "{emby-server}")

                for token in self.sensitive['Token']:
                    string = string.replace(token.encode('utf-8')  or "{token}", "{emby-token}")

            try:
                xbmc.log(string, level=xbmc.LOGNOTICE)
            except UnicodeEncodeError:
                xbmc.log(string.encode('utf-8'), level=xbmc.LOGNOTICE) 
开发者ID:MediaBrowser,项目名称:plugin.video.emby,代码行数:24,代码来源:loghandler.py

示例2: Get_Seasons

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGNOTICE [as 别名]
def Get_Seasons(url, name):#4
    r = client.request(url).decode('latin-1').encode('utf-8')
    episodes = client.parseDOM(r, 'div', attrs={'class': 'tab-content'})[0]
    data = client.parseDOM(r, 'div', attrs={'class': 'VideoPlayer'})[0]
    poster = client.parseDOM(r, 'img', ret='src')[0]
    ss = zip(client.parseDOM(data, 'a', ret='href'),
             client.parseDOM(data, 'a'))
    xbmc.log('@#@SEASONS:%s' % ss, xbmc.LOGNOTICE)
    desc = client.parseDOM(r, 'p', attrs={'class': 'text-dark font-size-13'})[0].encode('latin-1')
    desc = clear_Title(desc)
    for i in ss:
        xbmc.log('@#@FOR-i:%s' % i[1], xbmc.LOGNOTICE)
        season = re.sub('[\n|\t|\r|\s]', '', i[1])
        surl = url + '|' + episodes.encode('utf-8') + '|' + i[0][1:].encode('utf-8') + '|' + str(poster)
        title = '[B][COLOR white]%s [B]| [COLOR lime]%s[/COLOR][/B]' % (name, season)
        addDir(title, surl, 7, poster, FANART, desc)
    setView('movies', 'menu-view') 
开发者ID:bugatsinho,项目名称:bugatsinho.github.io,代码行数:19,代码来源:default.py

示例3: album_list

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGNOTICE [as 别名]
def album_list(name, url):
    link = GET_url(url)
    try:
        artist_url = regex_from_to(link, 'class="art_wrap__img" src="', '"')
        get_artist_icon(name, artist_url)
        xbmc.log("348 name = {0}\nartist_url = {1}".format(name, artist_url), xbmc.LOGNOTICE)
    except:
        pass
    all_albums = re.compile('<a class="album_report__link" href="(.+?)"><img alt="(.+?)" class="album_report__image" src="(.+?)"/><span class="album_report__name">(.+?)</span>(.+?)"album_report__artist" href="(.+?)">(.+?)</a>, <span class="album_report__date">(.+?)</span>').findall(link)
    #all_albums = re.compile('<a class="album_report__link" href="(.+?)"><img alt="(.+?)" class="album_report__image" src="(.+?)" /><span class="album_report__name">(.+?)</span>(.+?)"album_report__artist" href="(.+?)">(.+?)</a>, <span class="album_report__date">(.+?)</span>').findall(link)
    for url1,d1,thumb,album,plot,artisturl,artist,year in all_albums:
        title = "%s - %s - %s" % (artist, album, year)
        thumb = thumb.replace('al', 'alm').replace('covers', 'mcovers')
        addDir(title.replace('&amp;', 'and'),'http://musicmp3.ru' + url1,5,thumb,'albums')
    pgnumf = url.find('page=') + 5
    pgnum = int(url[pgnumf:]) + 1
    nxtpgurl = url[:pgnumf]
    nxtpgurl = "%s%s" % (nxtpgurl, pgnum)
    addDir('>> Next page', nxtpgurl, 15, art + 'nextpage.jpg', str(pgnumf))
    setView('movies', 'album') 
开发者ID:bugatsinho,项目名称:bugatsinho.github.io,代码行数:22,代码来源:default.py

示例4: albums

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGNOTICE [as 别名]
def albums(name, url):
    duplicate = []
    link = GET_url(url)
    try:
        artist_url = regex_from_to(link, 'class="album_report__image"\s*', '"')
        get_artist_icon(name, artist_url)
        xbmc.log("370 name = {0}\nartist_url = {1}".format(name, artist_url), xbmc.LOGNOTICE)
    except:
        pass
    all_albums = re.compile('<div class="album_report"><h5 class="album_report__heading"><a class="album_report__link" href="(.+?)"><img alt="(.+?)" class="album_report__image" src="(.+?)"/><span class="album_report__name">(.+?)</span></a></h5><div cla(.+?)lbum_report__second_line"><span class="album_report__date">(.+?)</span>').findall(link)
    #all_albums = re.compile('<div class="album_report"><h5 class="album_report__heading"><a class="album_report__link" href="(.+?)"><img alt="(.+?)" class="album_report__image" src="(.+?)"/><span class="album_report__name">(.+?)</span></a></h5><div class="album_report__second_line"><span class="album_report__date">(.+?)</span>').findall(link)
    for url1,d1,thumb,album,d2,year in all_albums:
        title = "%s - %s - %s" % (name, album, year)
        if title not in duplicate:
            duplicate.append(title)
            thumb = thumb.replace('al', 'alm').replace('covers', 'mcovers')
            addDir(title.replace('&amp;', 'and'),'http://musicmp3.ru' + url1,5,thumb,'albums')
    setView('movies', 'album') 
开发者ID:bugatsinho,项目名称:bugatsinho.github.io,代码行数:20,代码来源:default.py

示例5: log

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGNOTICE [as 别名]
def log(self, msg, level=LOGDEBUG):
        # if debug isn't on, skip disabled loggers unless addon_debug is on
        if not self.__debug_on:
            if self in self.__disabled:
                return
            elif level == LOGDEBUG:
                if self.__addon_debug:
                    level = LOGNOTICE
                else:
                    return

        try:
            if isinstance(msg, six.text_type) and six.PY2:
                msg = '%s (ENCODED)' % (msg.encode('utf-8'))

            xbmc.log('%s: %s' % (self.__name, msg), level)

        except Exception as e:
            try:
                xbmc.log('Logging Failure: %s' % (e), level)
            except:
                pass  # just give up 
开发者ID:tvaddonsco,项目名称:script.module.urlresolver,代码行数:24,代码来源:log_utils.py

示例6: show_notification

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGNOTICE [as 别名]
def show_notification():
    note_id, msg = window.split_notify(CONFIG.NOTIFICATION)
    
    if note_id:
        if note_id == CONFIG.NOTEID:
            if CONFIG.NOTEDISMISS == 'false':
                window.show_notification(msg)
            else:
                logging.log('[Notifications] No new notifications.', level=xbmc.LOGNOTICE)
        elif note_id > CONFIG.NOTEID:
            logging.log('[Notifications] Showing notification {0}'
                        .format(note_id))
            CONFIG.set_setting('noteid', note_id)
            CONFIG.set_setting('notedismiss', 'false')
            window.show_notification(msg)
    else:
        logging.log('[Notifications] Notifications file at {0} not formatted correctly.'
                    .format(CONFIG.NOTIFICATION),
                    level=xbmc.LOGNOTICE) 
开发者ID:a4k-openproject,项目名称:plugin.program.openwizard,代码行数:21,代码来源:startup.py

示例7: log

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGNOTICE [as 别名]
def log(msg, level=xbmc.LOGDEBUG):
    if CONFIG.DEBUGLEVEL == '0':  # No Logging
        return False
    if CONFIG.DEBUGLEVEL == '1':  # Normal Logging
        pass
    if CONFIG.DEBUGLEVEL == '2':  # Full Logging
        level = xbmc.LOGNOTICE
    
    xbmc.log('{0}: {1}'.format(CONFIG.ADDONTITLE, msg), level)
    if CONFIG.ENABLEWIZLOG == 'true':
        if not os.path.exists(CONFIG.WIZLOG):
            with open(CONFIG.WIZLOG, 'w+') as f:
                f.close()

        lastcheck = CONFIG.NEXTCLEANDATE if not CONFIG.NEXTCLEANDATE == 0 else tools.get_date()
        if CONFIG.CLEANWIZLOG == 'true' and time.mktime(time.strptime(lastcheck, "%Y-%m-%d %H:%M:%S")) <= tools.get_date():
            check_log()

        line = "[{0}] {1}".format(tools.get_date(formatted=True), msg)
        line = line.rstrip('\r\n') + '\n'
        tools.write_to_file(CONFIG.WIZLOG, line, mode='a') 
开发者ID:a4k-openproject,项目名称:plugin.program.openwizard,代码行数:23,代码来源:logging.py

示例8: show_result

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGNOTICE [as 别名]
def show_result(message, url=None):
    from resources.libs.gui import window

    dialog = xbmcgui.Dialog()

    if url:
        try:
            from resources.libs import qr
            
            fn = url.split('/')[-2]
            imagefile = qr.generate_code(url, fn)
            window.show_qr_code("loguploader.xml", imagefile, message)
            try:
                os.remove(imagefile)
            except:
                pass
        except Exception as e:
            log(str(e), xbmc.LOGNOTICE)
            confirm = dialog.ok(CONFIG.ADDONTITLE, "[COLOR %s]%s[/COLOR]" % (CONFIG.COLOR2, message))
    else:
        confirm = dialog.ok(CONFIG.ADDONTITLE, "[COLOR %s]%s[/COLOR]" % (CONFIG.COLOR2, message)) 
开发者ID:a4k-openproject,项目名称:plugin.program.openwizard,代码行数:23,代码来源:logging.py

示例9: set_arttypes

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGNOTICE [as 别名]
def set_arttypes(root, arttype_map):
    for key, artlist in arttype_map.items():
        if key not in mediatype_map:
            if key not in unsupported_types:
                log("Can't set arttypes for '{0}' in advancedsettings.xml".format(key), xbmc.LOGNOTICE)
            continue
        typemap = mediatype_map[key]
        library_elem = root.find(typemap[1])
        if library_elem is None:
            library_elem = ET.SubElement(root, typemap[1])
        mediatype_elem = library_elem.find(typemap[0])
        if artlist:
            if mediatype_elem is None:
                mediatype_elem = ET.SubElement(library_elem, typemap[0])
            else:
                mediatype_elem.clear()
            for arttype in artlist:
                if arttype in typemap[2]:
                    continue
                arttype_elem = ET.SubElement(mediatype_elem, ARTTYPE_TAG)
                arttype_elem.text = arttype
        elif mediatype_elem is not None:
            library_elem.remove(mediatype_elem) 
开发者ID:rmrector,项目名称:script.artwork.beef,代码行数:25,代码来源:advancedsettings.py

示例10: log

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGNOTICE [as 别名]
def log(message, level=xbmc.LOGDEBUG, tag=None):
    if is_addon_watched() and level < xbmc.LOGNOTICE:
        # Messages from this add-on are being watched, elevate to NOTICE so Kodi logs it
        level_tag = _log_level_tag_lookup[level] + ': ' if level in _log_level_tag_lookup else ''
        level = xbmc.LOGNOTICE
    else:
        level_tag = ''

    if isinstance(message, (dict, list)) and len(message) > 300:
        message = str(message)
    elif isinstance(message, unicode):
        message = message.encode('utf-8')
    elif not isinstance(message, str):
        message = json.dumps(message, cls=UTF8PrettyJSONEncoder)

    addontag = ADDONID if not tag else ADDONID + ':' + tag
    file_message = '%s[%s] %s' % (level_tag, addontag, scrub_message(message))
    xbmc.log(file_message, level) 
开发者ID:rmrector,项目名称:script.artwork.beef,代码行数:20,代码来源:pykodi.py

示例11: config

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGNOTICE [as 别名]
def config():
    global _config
    if not _config:
        with shelf("antizapret.pac_config", ttl=CACHE) as pac:
            if not pac.get("value"):
                xbmc.log("[script.module.antizapret]: Fetching Antizapret PAC file", level=xbmc.LOGNOTICE)
                try:
                    data = urllib2.urlopen(PAC_URL).read()
                except:
                    data = ""

                r = re.search(r"\"PROXY (.*); DIRECT", data)
                pac["value"] = {
                    "server": None,
                    "domains": []
                }
                if r:
                    pac["value"]["server"] = r.group(1)
                    pac["value"]["domains"] = map(lambda x: x.replace(r"\Z(?ms)", "").replace("\\", ""), map(fnmatch.translate, re.findall(r"\"(.*?)\",", data)))

            _config = pac["value"]
    return _config 
开发者ID:seppius-xbmc-repo,项目名称:ru,代码行数:24,代码来源:antizapret.py

示例12: log

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGNOTICE [as 别名]
def log(self, txt = '', level=xbmc.LOGDEBUG):
        ''' Log a text into the Kodi-Logfile '''
        try:
            if self.detailLevel > 0 or level == xbmc.LOGERROR:
                if self.detailLevel == 2 and level == xbmc.LOGDEBUG:
                    # More Logging
                    level = xbmc.LOGNOTICE
                elif self.detailLevel == 3 and (level == xbmc.LOGDEBUG or level == xbmc.LOGSEVERE):
                    # Complex Logging
                    level = xbmc.LOGNOTICE
                if level != xbmc.LOGSEVERE:
                    if isinstance(txt, unicode):
                        txt = unidecode(txt)
                    xbmc.log(b"[%s] %s" % (self.pluginName, txt), level) 
        except:
            xbmc.log(b"[%s] Unicode Error in message text" % self.pluginName, xbmc.LOGERROR) 
开发者ID:arnesongit,项目名称:plugin.audio.tidal2,代码行数:18,代码来源:debug.py

示例13: emit

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGNOTICE [as 别名]
def emit(self, record):
        if record.levelno < logging.WARNING and self._modules and not record.name in self._modules:
            # Log INFO and DEBUG only with enabled modules
            return
        levels = {
            logging.CRITICAL: xbmc.LOGFATAL,
            logging.ERROR: xbmc.LOGERROR,
            logging.WARNING: xbmc.LOGWARNING,
            logging.INFO: xbmc.LOGNOTICE,
            logging.DEBUG: xbmc.LOGSEVERE,
            logging.NOTSET: xbmc.LOGNONE,
        }
        try:
            xbmc.log(self.format(record), levels[record.levelno])
        except:
            try:
                xbmc.log(self.format(record).encode('utf-8', 'ignore'), levels[record.levelno])
            except:
                xbmc.log(b"[%s] Unicode Error in message text" % self.pluginName, levels[record.levelno]) 
开发者ID:arnesongit,项目名称:plugin.audio.tidal2,代码行数:21,代码来源:debug.py

示例14: onInit

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGNOTICE [as 别名]
def onInit(self, success):
        if success:
            xbmc.log("[script.tvguide.fullscreen] Background Update Starting...", xbmc.LOGNOTICE)
            self.database.updateChannelAndProgramListCaches(self.onCachesUpdated)
        else:
            self.database.close() 
开发者ID:primaeval,项目名称:script.tvguide.fullscreen,代码行数:8,代码来源:service.py

示例15: onCachesUpdated

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGNOTICE [as 别名]
def onCachesUpdated(self):
        if ADDON.getSetting('notifications.enabled') == 'true':
            n = notification.Notification(self.database, ADDON.getAddonInfo('path'))
            n.scheduleNotifications()
        if ADDON.getSetting('autoplays.enabled') == 'true':
            n = autoplay.Autoplay(self.database, ADDON.getAddonInfo('path'))
            n.scheduleAutoplays()
        if ADDON.getSetting('autoplaywiths.enabled') == 'true':
            n = autoplaywith.Autoplaywith(self.database, ADDON.getAddonInfo('path'))
            n.scheduleAutoplaywiths()
        self.database.close(None)
        xbmc.log("[script.tvguide.fullscreen] Background Update Finished", xbmc.LOGNOTICE)
        if ADDON.getSetting('background.notify') == 'true':
            d = xbmcgui.Dialog()
            d.notification("TV Guide Fullscreen", "Finished Updating") 
开发者ID:primaeval,项目名称:script.tvguide.fullscreen,代码行数:17,代码来源:service.py


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