mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-03 07:57:49 +00:00
docker: python3
This commit is contained in:
parent
eb8225aba3
commit
9dafa22583
@ -1,5 +1,6 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
# Copyright (C) 2009-2016 Lukas Rusak (lrusak@libreelec.tv)
|
# Copyright (C) 2009-2016 Lukas Rusak (lrusak@libreelec.tv)
|
||||||
|
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
@ -187,31 +188,31 @@ def print_notification(json_data):
|
|||||||
if __addon__.getSetting('notifications') is '0': # default
|
if __addon__.getSetting('notifications') is '0': # default
|
||||||
if docker_events[json_data['Type']]['event'][json_data['Action']]['enabled']:
|
if docker_events[json_data['Type']]['event'][json_data['Action']]['enabled']:
|
||||||
try:
|
try:
|
||||||
message = unicode(' '.join([__addon__.getLocalizedString(30010),
|
message = ' '.join([__addon__.getLocalizedString(30010),
|
||||||
json_data['Actor']['Attributes']['name'],
|
json_data['Actor']['Attributes']['name'],
|
||||||
'|',
|
'|',
|
||||||
__addon__.getLocalizedString(30012),
|
__addon__.getLocalizedString(30012),
|
||||||
__addon__.getLocalizedString(event_string)]))
|
__addon__.getLocalizedString(event_string)])
|
||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
message = unicode(' '.join([__addon__.getLocalizedString(30011),
|
message = ' '.join([__addon__.getLocalizedString(30011),
|
||||||
json_data['Type'],
|
json_data['Type'],
|
||||||
'|',
|
'|',
|
||||||
__addon__.getLocalizedString(30012),
|
__addon__.getLocalizedString(30012),
|
||||||
__addon__.getLocalizedString(event_string)]))
|
__addon__.getLocalizedString(event_string)])
|
||||||
|
|
||||||
elif __addon__.getSetting('notifications') is '1': # all
|
elif __addon__.getSetting('notifications') is '1': # all
|
||||||
try:
|
try:
|
||||||
message = unicode(' '.join([__addon__.getLocalizedString(30010),
|
message = ' '.join([__addon__.getLocalizedString(30010),
|
||||||
json_data['Actor']['Attributes']['name'],
|
json_data['Actor']['Attributes']['name'],
|
||||||
'|',
|
'|',
|
||||||
__addon__.getLocalizedString(30012),
|
__addon__.getLocalizedString(30012),
|
||||||
__addon__.getLocalizedString(event_string)]))
|
__addon__.getLocalizedString(event_string)])
|
||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
message = unicode(' '.join([__addon__.getLocalizedString(30011),
|
message = ' '.join([__addon__.getLocalizedString(30011),
|
||||||
json_data['Type'],
|
json_data['Type'],
|
||||||
'|',
|
'|',
|
||||||
__addon__.getLocalizedString(30012),
|
__addon__.getLocalizedString(30012),
|
||||||
__addon__.getLocalizedString(event_string)]))
|
__addon__.getLocalizedString(event_string)])
|
||||||
|
|
||||||
elif __addon__.getSetting('notifications') is '2': # none
|
elif __addon__.getSetting('notifications') is '2': # none
|
||||||
pass
|
pass
|
||||||
@ -219,24 +220,24 @@ def print_notification(json_data):
|
|||||||
elif __addon__.getSetting('notifications') is '3': # custom
|
elif __addon__.getSetting('notifications') is '3': # custom
|
||||||
if __addon__.getSetting(json_data['Action']) == 'true':
|
if __addon__.getSetting(json_data['Action']) == 'true':
|
||||||
try:
|
try:
|
||||||
message = unicode(' '.join([__addon__.getLocalizedString(30010),
|
message = ' '.join([__addon__.getLocalizedString(30010),
|
||||||
json_data['Actor']['Attributes']['name'],
|
json_data['Actor']['Attributes']['name'],
|
||||||
'|',
|
'|',
|
||||||
__addon__.getLocalizedString(30012),
|
__addon__.getLocalizedString(30012),
|
||||||
__addon__.getLocalizedString(event_string)]))
|
__addon__.getLocalizedString(event_string)])
|
||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
message = unicode(' '.join([__addon__.getLocalizedString(30011),
|
message = ' '.join([__addon__.getLocalizedString(30011),
|
||||||
json_data['Type'],
|
json_data['Type'],
|
||||||
'|',
|
'|',
|
||||||
__addon__.getLocalizedString(30012),
|
__addon__.getLocalizedString(30012),
|
||||||
__addon__.getLocalizedString(event_string)]))
|
__addon__.getLocalizedString(event_string)])
|
||||||
|
|
||||||
dialog = xbmcgui.Dialog()
|
dialog = xbmcgui.Dialog()
|
||||||
try:
|
try:
|
||||||
if message is not '':
|
if message is not '':
|
||||||
length = int(__addon__.getSetting('notification_length')) * 1000
|
length = int(__addon__.getSetting('notification_length')) * 1000
|
||||||
dialog.notification('Docker', message, '/storage/.kodi/addons/service.system.docker/resources/icon.png', length)
|
dialog.notification('Docker', message, '/storage/.kodi/addons/service.system.docker/resources/icon.png', length)
|
||||||
xbmc.log('## service.system.docker ## ' + unicode(message))
|
xbmc.log('## service.system.docker ## %s' % message)
|
||||||
except NameError as e:
|
except NameError as e:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user