當前位置: 首頁>>代碼示例>>Python>>正文


Python xbmcgui.NOTIFICATION_INFO屬性代碼示例

本文整理匯總了Python中xbmcgui.NOTIFICATION_INFO屬性的典型用法代碼示例。如果您正苦於以下問題:Python xbmcgui.NOTIFICATION_INFO屬性的具體用法?Python xbmcgui.NOTIFICATION_INFO怎麽用?Python xbmcgui.NOTIFICATION_INFO使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在xbmcgui的用法示例。


在下文中一共展示了xbmcgui.NOTIFICATION_INFO屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: initialize_db

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import NOTIFICATION_INFO [as 別名]
def initialize_db(self):
        conn = database.connect(_subreddits_file)
        cur = conn.cursor()
        cur.execute("DROP TABLE IF EXISTS subreddits;")
        cur.execute("CREATE TABLE IF NOT EXISTS {tbl} (""url TEXT, ""name TEXT, ""UNIQUE(url)"");".format(tbl=_db_table))
        for k in default_streaming_subreddits:
            cur.execute("INSERT INTO {tbl} VALUES ('{url}', '{name}')".format(
                tbl=_db_table, url=k['url'], name=k['name']))
        conn.commit()
        xbmcgui.Dialog().notification(
            heading="DB Initialized",
            message="Initialized ",
            icon=xbmcgui.NOTIFICATION_INFO,
            time=3000,
            sound=False)
        return conn 
開發者ID:iwannabelikemike,項目名稱:plugin.video.sparkle,代碼行數:18,代碼來源:subreddit_lists.py

示例2: add_entry

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import NOTIFICATION_INFO [as 別名]
def add_entry(self, url, name):
        cur = self.conn.cursor()
        try:
            statement = "INSERT INTO {} (url, name) VALUES ('{}', '{}')".format(_db_table, url, name)
            log(statement)
            cur.execute(statement)
            self.conn.commit()
        except:
            xbmcgui.Dialog().notification(
                heading="Add entry",
                message="Couldn't add entry ({}, {}) for some reason".format(url, name),
                icon=xbmcgui.NOTIFICATION_INFO,
                time=3000,
                sound=False)
            raise

        xbmcgui.Dialog().notification(
            heading="Add entry",
            message="{} added".format(url),
            icon=xbmcgui.NOTIFICATION_INFO,
            time=3000,
            sound=False) 
開發者ID:iwannabelikemike,項目名稱:plugin.video.sparkle,代碼行數:24,代碼來源:subreddit_lists.py

示例3: delete_entry

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import NOTIFICATION_INFO [as 別名]
def delete_entry(self, url):
        cur = self.conn.cursor()
        try:
            statement = "DELETE FROM {} WHERE url = '{}'".format(_db_table, url)
            log(statement)
            cur.execute(statement)
            self.conn.commit()
        except:
            xbmcgui.Dialog().notification(
                heading="Delete",
                message="Couldn't delete {} for some reason".format(url),
                icon=xbmcgui.NOTIFICATION_INFO,
                time=3000,
                sound=False)
            raise

        xbmcgui.Dialog().notification(
            heading="Delete",
            message="{} deleted".format(url),
            icon=xbmcgui.NOTIFICATION_INFO,
            time=3000,
            sound=False) 
開發者ID:iwannabelikemike,項目名稱:plugin.video.sparkle,代碼行數:24,代碼來源:subreddit_lists.py

示例4: identify_unmatched

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import NOTIFICATION_INFO [as 別名]
def identify_unmatched(mediatype):
    busy = pykodi.get_busydialog()
    busy.create()
    processed = ProcessedItems()
    ulist = quickjson.get_item_list(mediatype)
    if mediatype == mediatypes.MUSICVIDEO:
        for item in ulist:
            item['label'] = info.build_music_label(item)
    unmatched = [item for item in ulist if not processed.get_data(item[mediatype + 'id'], mediatype, item['label'])]
    busy.close()
    if unmatched:
        selected = xbmcgui.Dialog().select(L(M.UNMATCHED_ITEMS), [item['label'] for item in unmatched])
        if selected < 0:
            return # Cancelled
        mediaitem = info.MediaItem(unmatched[selected])
        info.add_additional_iteminfo(mediaitem, processed, search)
        processor = ArtworkProcessor()
        if processor.manual_id(mediaitem):
            processor.process_item(mediatype, mediaitem.dbid, 'auto')
    else:
        xbmcgui.Dialog().notification("Artwork Beef", L(M.NO_UNMATCHED_ITEMS), xbmcgui.NOTIFICATION_INFO) 
開發者ID:rmrector,項目名稱:script.artwork.beef,代碼行數:23,代碼來源:default.py

示例5: show_notification

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import NOTIFICATION_INFO [as 別名]
def show_notification(self, heading, message, icon=xbmcgui.NOTIFICATION_INFO, time=5000, sound=True):
        """
        Shows a notification to the user

        Args:
            heading(str|int): Heading text of the notification.
                Can be a string or a numerical id to a localized text.

            message(str|int): Text of the notification.
                Can be a string or a numerical id to a localized text.

            icon(id, optional): xbmc id of the icon. Can be `xbmcgui.NOTIFICATION_INFO`,
                `xbmcgui.NOTIFICATION_WARNING` or `xbmcgui.NOTIFICATION_ERROR`.
                Default is `xbmcgui.NOTIFICATION_INFO`

            time(int, optional): Number of milliseconds the notification stays
                visible. Default is 5000.

            sound(bool, optional): If `True` a sound is played. Default is `True`
        """
        heading = self.language(heading) if isinstance(
            heading, int) else heading
        message = self.language(message) if isinstance(
            message, int) else message
        xbmcgui.Dialog().notification(heading, message, icon, time, sound) 
開發者ID:mediathekview,項目名稱:plugin.video.mediathekview,代碼行數:27,代碼來源:kodiui.py

示例6: get_search

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import NOTIFICATION_INFO [as 別名]
def get_search(keyword, page):
    serachUrl = 'https://www.acfun.cn/rest/pc-direct/search/video?keyword=' + keyword + '&pCursor=' + str(page)

    r = requests.get(serachUrl, headers=headers)
    r.encoding = 'UTF-8'
    rtext = r.text
    j = json.loads(rtext)
    #dialog = xbmcgui.Dialog()
    #ok = dialog.ok('錯誤提示', str(j['videoList'][0]['id']))
    videos = []
    if 'videoList' in j:
        for index in range(len(j['videoList'])):
            videoitem = {}
            videoitem['name'] = j['videoList'][index]['title']
            videoitem['href'] = 'https://www.acfun.cn/v/ac'+ str(j['videoList'][index]['id'])
            videoitem['thumb'] = j['videoList'][index]['coverUrl']
            videos.append(videoitem)
        dialog = xbmcgui.Dialog()
        dialog.notification('當前'+ str(page) + '/' + str(j['pageNum']) + '頁', '總共'+ str(j['totalNum']) + '個視頻', xbmcgui.NOTIFICATION_INFO, 5000,False)
    else:
        dialog = xbmcgui.Dialog()
        ok = dialog.ok('錯誤提示', '搜索結果為空')
    return videos 
開發者ID:taxigps,項目名稱:xbmc-addons-chinese,代碼行數:25,代碼來源:addon.py

示例7: get_up

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import NOTIFICATION_INFO [as 別名]
def get_up(uid,page):
    videos = []
    apiurl = 'https://www.acfun.cn/space/next?uid='+str(uid)+'&type=video&orderBy=2&pageNo=' +str(page)
    rec = requests.get(apiurl,headers=headers)
    #print(rec.text)
    j = json.loads(rec.text)
    dialog = xbmcgui.Dialog()
    dialog.notification('當前'+ str(j['data']['page']['pageNo']) + '/' + str(j['data']['page']['totalPage']) + '頁', '總共'+ str(j['data']['page']['totalCount']) + '個視頻', xbmcgui.NOTIFICATION_INFO, 5000,False)
    html = j['data']['html']
    soup = BeautifulSoup(html,'html.parser')
    #print(html)
    fig = soup.find_all('figure')
    #print(len(fig))
    for index in range(len(fig)):
        videoitem = {}
        videoitem['name'] = fig[index]['data-title']
        videoitem['href'] = 'https://www.acfun.cn'+fig[index]['data-url']
        videoitem['thumb'] = fig[index].img['src']
        videos.append(videoitem)
    return videos 
開發者ID:taxigps,項目名稱:xbmc-addons-chinese,代碼行數:22,代碼來源:addon.py

示例8: showInfoNotification

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import NOTIFICATION_INFO [as 別名]
def showInfoNotification(message):
    xbmcgui.Dialog().notification("SendToKodi", message, xbmcgui.NOTIFICATION_INFO, 5000) 
開發者ID:firsttris,項目名稱:plugin.video.sendtokodi,代碼行數:4,代碼來源:service.py

示例9: message_ok

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import NOTIFICATION_INFO [as 別名]
def message_ok(message):
        xbmcgui.Dialog().notification("Soap4.me", message, icon=xbmcgui.NOTIFICATION_INFO, sound=False) 
開發者ID:Soap4me,項目名稱:Kodi,代碼行數:4,代碼來源:addon.py

示例10: infoDialog

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import NOTIFICATION_INFO [as 別名]
def infoDialog(message, heading=addonInfo('name'), icon='', time=3000, sound=False):
    if icon == '': icon = addonIcon()
    elif icon == 'INFO': icon = xbmcgui.NOTIFICATION_INFO
    elif icon == 'WARNING': icon = xbmcgui.NOTIFICATION_WARNING
    elif icon == 'ERROR': icon = xbmcgui.NOTIFICATION_ERROR
    dialog.notification(heading, message, icon, time, sound=sound) 
開發者ID:iwannabelikemike,項目名稱:plugin.video.sparkle,代碼行數:8,代碼來源:control.py

示例11: show_artwork_log

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import NOTIFICATION_INFO [as 別名]
def show_artwork_log():
    if pykodi.get_kodi_version() < 16:
        xbmcgui.Dialog().notification("Artwork Beef", L(M.VERSION_REQUIRED).format("Kodi 16"), xbmcgui.NOTIFICATION_INFO)
        return
    xbmcgui.Dialog().textviewer("Artwork Beef: " + L(M.REPORT_TITLE), reporting.get_latest_report()) 
開發者ID:rmrector,項目名稱:script.artwork.beef,代碼行數:7,代碼來源:default.py

示例12: dialog_notification

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import NOTIFICATION_INFO [as 別名]
def dialog_notification(heading, message, icon=0, time=5000, sound=True):
    dialog = xbmcgui.Dialog()
    try:
        l_icono = xbmcgui.NOTIFICATION_INFO, xbmcgui.NOTIFICATION_WARNING, xbmcgui.NOTIFICATION_ERROR
        dialog.notification(heading, message, l_icono[icon], time, sound)
    except:
        dialog_ok(heading, message) 
開發者ID:alfa-addon,項目名稱:addon,代碼行數:9,代碼來源:platformtools.py

示例13: clear_cache

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import NOTIFICATION_INFO [as 別名]
def clear_cache():
    info = plugin.get_storage('info')
    homemenu = plugin.get_storage('homemenu')
    pcs_info = plugin.get_storage('pcs_info')
    info.clear()
    homemenu.clear()
    pcs_info.clear()
    dialog.notification('', u'清除完畢', xbmcgui.NOTIFICATION_INFO, 3000)
    xbmc.executebuiltin('Container.Refresh')
    return 
開發者ID:taxigps,項目名稱:xbmc-addons-chinese,代碼行數:12,代碼來源:default.py

示例14: playlist_path

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import NOTIFICATION_INFO [as 別名]
def playlist_path(pcs_file_path, stream):
    user_info = get_user_info()
    user_name = user_info['username']
    user_cookie = user_info['cookie']
    user_tokens = user_info['tokens']

    if stream:
        playlist_data = pcs.get_streaming_playlist(user_cookie, pcs_file_path, stream)
        if playlist_data:
            raw_dir = os.path.dirname(pcs_file_path)
            m = re.search('\/(.*)', raw_dir)
            dirname = m.group(1)
            basename = os.path.basename(pcs_file_path)
            r = re.search('(.*)\.(.*)$', basename)
            filename = ''.join([r.group(1), stream, '.m3u8'])
            dirpath = os.path.join(utils.data_dir(), user_name, dirname)
            if not xbmcvfs.exists(dirpath):
                xbmcvfs.mkdirs(dirpath)
            filepath = os.path.join(dirpath, filename)
            tmpFile = xbmcvfs.File(filepath, 'w')
            tmpFile.write(bytearray(playlist_data, 'utf-8'))
            return filepath
        else:
            dialog.notification('', u'無法打開視頻', xbmcgui.NOTIFICATION_INFO, 4000)
            return None
    else:
        url = pcs.stream_download(user_cookie, user_tokens, pcs_file_path)
        if url:
            return url
        else:
            dialog.notification('', u'無法打開原畫,請嘗試流暢模式', xbmcgui.NOTIFICATION_INFO, 4000)
            return None 
開發者ID:taxigps,項目名稱:xbmc-addons-chinese,代碼行數:34,代碼來源:default.py

示例15: favorites_add

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import NOTIFICATION_INFO [as 別名]
def favorites_add(content_type, item_id):
    ok = session.user.favorites.add(content_type, item_id)
    if ok:
        xbmcgui.Dialog().notification(heading=plugin.name, message=_T(30231).format(what=_T(content_type)), icon=xbmcgui.NOTIFICATION_INFO)
    xbmc.executebuiltin('Container.Refresh()') 
開發者ID:arnesongit,項目名稱:plugin.audio.tidal2,代碼行數:7,代碼來源:addon.py


注:本文中的xbmcgui.NOTIFICATION_INFO屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。