本文整理汇总了Python中xbmcgui.NOTIFICATION_ERROR属性的典型用法代码示例。如果您正苦于以下问题:Python xbmcgui.NOTIFICATION_ERROR属性的具体用法?Python xbmcgui.NOTIFICATION_ERROR怎么用?Python xbmcgui.NOTIFICATION_ERROR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类xbmcgui
的用法示例。
在下文中一共展示了xbmcgui.NOTIFICATION_ERROR属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make_local
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import NOTIFICATION_ERROR [as 别名]
def make_local():
fileman = FileManager()
def downloadforitem(mediaitem):
try:
fileman.downloadfor(mediaitem)
newart = dict((k, v) for k, v in mediaitem.downloadedart.iteritems()
if not v or not v.startswith('http'))
for arttype in newart:
# remove old URL from texture cache
if mediaitem.art.get(arttype, '').startswith('http'):
quickjson.remove_texture_byurl(mediaitem.art[arttype])
return newart
except FileError as ex:
mediaitem.error = ex.message
log(ex.message, xbmc.LOGERROR)
xbmcgui.Dialog().notification("Artwork Beef", ex.message, xbmcgui.NOTIFICATION_ERROR)
return {}
downloaded = runon_medialist(downloadforitem, L(M.MAKE_LOCAL), fg=True)
xbmcgui.Dialog().ok("Artwork Beef", L(M.DOWNLOAD_COUNT).format(downloaded)
+ ' - {0:0.2f}MB'.format(fileman.size / 1000000.00))
示例2: show_notification
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import NOTIFICATION_ERROR [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)
示例3: show_error
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import NOTIFICATION_ERROR [as 别名]
def show_error(self, heading, message, time=8000, sound=True):
"""
Shows an error 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.
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`
"""
self.show_notification(
heading, message, xbmcgui.NOTIFICATION_ERROR, time, sound)
示例4: get_album_json_thread
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import NOTIFICATION_ERROR [as 别名]
def get_album_json_thread(self):
try:
while not xbmc.Monitor().waitForAbort(timeout=0.01) and not self.abortAlbumThreads:
try:
album_id = self.albumQueue.get_nowait()
except:
break
try:
self.get_album(album_id, withCache=False)
except requests.HTTPError as e:
r = e.response
msg = _T(30505)
try:
msg = r.reason
msg = r.json().get('userMessage')
except:
pass
log('Error getting Album ID %s' % album_id, xbmc.LOGERROR)
if r.status_code == 429 and not self.abortAlbumThreads:
self.abortAlbumThreads = True
log('Too many requests. Aborting Workers ...', xbmc.LOGERROR)
self.albumQueue._init(9999)
xbmcgui.Dialog().notification(plugin.name, msg, xbmcgui.NOTIFICATION_ERROR)
except Exception, e:
traceback.print_exc()
示例5: user_playlist_move_entry
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import NOTIFICATION_ERROR [as 别名]
def user_playlist_move_entry(playlist_id, entry_no, item_id):
dialog = xbmcgui.Dialog()
playlist = session.user.selectPlaylistDialog(headline=_T(30248), allowNew=True)
if playlist and playlist.id <> playlist_id:
session.show_busydialog(_T(30265), playlist.name)
try:
ok = session.user.add_playlist_entries(playlist=playlist, item_ids=[item_id])
if ok:
ok = session.user.remove_playlist_entry(playlist_id, entry_no=entry_no)
else:
dialog.notification(plugin.name, _T('API Call Failed'), xbmcgui.NOTIFICATION_ERROR)
except Exception, e:
log(str(e), level=xbmc.LOGERROR)
traceback.print_exc()
session.hide_busydialog()
xbmc.executebuiltin('Container.Refresh()')
示例6: run
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import NOTIFICATION_ERROR [as 别名]
def run(self):
import objects
''' Workaround for widgets only playback.
Widgets start with a music playlist, this causes bugs in skin, etc.
Create a new video playlist for the item and play it.
'''
xbmc.sleep(200) # Let Kodi catch up
LOG.info("-->[ widget play ]")
play = None
xbmc.PlayList(xbmc.PLAYLIST_MUSIC).clear()
xbmc.PlayList(xbmc.PLAYLIST_VIDEO).clear()
objects.utils.enable_busy_dialog()
try:
server = self.params.get('server')
if not server and not window('emby_online.bool'):
dialog("notification", heading="{emby}", message=_(33146), icon=xbmcgui.NOTIFICATION_ERROR)
raise Exception("NotConnected")
play = objects.PlayStrm(self.params, server)
play.play()
except Exception as error:
LOG.exception(error)
objects.utils.disable_busy_dialog()
xbmc.Player().stop() # mute failed playback pop up
xbmc.PlayList(xbmc.PLAYLIST_VIDEO).clear()
else:
objects.utils.disable_busy_dialog()
window('emby.play.widget.bool', True)
play.start_playback()
self.server.pending = []
LOG.info("--<[ widget play ]")
示例7: showErrorNotification
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import NOTIFICATION_ERROR [as 别名]
def showErrorNotification(message):
xbmcgui.Dialog().notification("SendToKodi", message,
xbmcgui.NOTIFICATION_ERROR, 5000)
# Get the plugin url in plugin:// notation.
示例8: message_error
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import NOTIFICATION_ERROR [as 别名]
def message_error(message):
xbmcgui.Dialog().notification("Soap4.me", message, icon=xbmcgui.NOTIFICATION_ERROR, sound=False)
示例9: infoDialog
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import NOTIFICATION_ERROR [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)
示例10: notify_warning
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import NOTIFICATION_ERROR [as 别名]
def notify_warning(self, message, header=None, error=False):
if settings.progressdisplay != PROGRESS_DISPLAY_NONE:
header = "Artwork Beef: " + header if header else "Artwork Beef"
xbmcgui.Dialog().notification(header, message,
xbmcgui.NOTIFICATION_ERROR if error else xbmcgui.NOTIFICATION_WARNING)
示例11: dialog_notification
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import NOTIFICATION_ERROR [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)
示例12: playList
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import NOTIFICATION_ERROR [as 别名]
def playList(url):
song = music.getPlayList(url)[0]
if len(song) == 5:
play(*song)
else:
xbmcgui.Dialog().notification(url, song[0], xbmcgui.NOTIFICATION_ERROR)
示例13: playLevel
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import NOTIFICATION_ERROR [as 别名]
def playLevel():
dp = xbmcgui.DialogProgressBG();
dp.create('IPTV', 'Loading ...');
title = args['title'][0];
cmd = args['cmd'][0];
tmp = args['tmp'][0];
genre_name = args['genre_name'][0];
logo_url = args['logo_url'][0];
try:
if genre_name != 'VoD':
url = load_channels.retriveUrl(portal['mac'], portal['url'], portal['serial'], cmd, tmp);
else:
url = load_channels.retriveVoD(portal['mac'], portal['url'], portal['serial'], cmd);
except Exception as e:
dp.close();
xbmcgui.Dialog().notification(addonname, str(e), xbmcgui.NOTIFICATION_ERROR );
return;
dp.update(80);
title = title.decode("utf-8");
title += ' (' + portal['name'] + ')';
li = xbmcgui.ListItem(title, iconImage=logo_url);
li.setInfo('video', {'Title': title, 'Genre': genre_name});
xbmc.Player().play(item=url, listitem=li);
dp.update(100);
dp.close();
示例14: configMac
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import NOTIFICATION_ERROR [as 别名]
def configMac(number):
global go;
custom_mac = addon.getSetting('custom_mac_' + number);
portal_mac = addon.getSetting('portal_mac_' + number);
if custom_mac != 'true':
portal_mac = '';
elif not (custom_mac == 'true' and re.match("[0-9a-f]{2}([-:])[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$", portal_mac.lower()) != None):
xbmcgui.Dialog().notification(addonname, 'Custom Mac ' + number + ' is Invalid.', xbmcgui.NOTIFICATION_ERROR );
portal_mac = '';
go=False;
return portal_mac;
示例15: configSerialNumber
# 需要导入模块: import xbmcgui [as 别名]
# 或者: from xbmcgui import NOTIFICATION_ERROR [as 别名]
def configSerialNumber(number):
global go;
send_serial = addon.getSetting('send_serial_' + number);
custom_serial = addon.getSetting('custom_serial_' + number);
serial_number = addon.getSetting('serial_number_' + number);
device_id = addon.getSetting('device_id_' + number);
device_id2 = addon.getSetting('device_id2_' + number);
signature = addon.getSetting('signature_' + number);
if send_serial != 'true':
return None;
elif send_serial == 'true' and custom_serial == 'false':
return {'custom' : False};
elif send_serial == 'true' and custom_serial == 'true':
if serial_number == '' or device_id == '' or device_id2 == '' or signature == '':
xbmcgui.Dialog().notification(addonname, 'Serial information is invalid.', xbmcgui.NOTIFICATION_ERROR );
go=False;
return None;
return {'custom' : True, 'sn' : serial_number, 'device_id' : device_id, 'device_id2' : device_id2, 'signature' : signature};
return None;