本文整理汇总了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
示例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)
示例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)
示例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)
示例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)
示例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
示例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
示例8: showInfoNotification
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import NOTIFICATION_INFO [as 别名]
def showInfoNotification(message):
xbmcgui.Dialog().notification("SendToKodi", message, xbmcgui.NOTIFICATION_INFO, 5000)
示例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)
示例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)
示例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())
示例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)
示例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
示例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
示例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()')