use try in case pynotify isnt installed
This commit is contained in:
parent
9604c3ff09
commit
a4373ef156
|
@ -97,14 +97,17 @@ class TorrentNotification:
|
||||||
|
|
||||||
def show_notification(self, event):
|
def show_notification(self, event):
|
||||||
if not deluge.common.windows_check():
|
if not deluge.common.windows_check():
|
||||||
|
try:
|
||||||
import pynotify
|
import pynotify
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
file_info = self.interface.manager.get_torrent_file_info(event['unique_ID'])
|
file_info = self.interface.manager.get_torrent_file_info(event['unique_ID'])
|
||||||
filelist = ""
|
filelist = ""
|
||||||
for file in file_info[:10]:
|
for file in file_info[:10]:
|
||||||
filelist += file['path'] + "\n"
|
filelist += file['path'] + "\n"
|
||||||
if len(file_info) > 10:
|
if len(file_info) > 10:
|
||||||
filelist += '...'
|
filelist += '...'
|
||||||
|
|
||||||
if pynotify.init("Deluge"):
|
if pynotify.init("Deluge"):
|
||||||
n = pynotify.Notification(_("Torrent complete"),
|
n = pynotify.Notification(_("Torrent complete"),
|
||||||
_("Files") + ":\n" + filelist)
|
_("Files") + ":\n" + filelist)
|
||||||
|
|
Loading…
Reference in New Issue