mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
use try in case pynotify isnt installed
This commit is contained in:
parent
9604c3ff09
commit
a4373ef156
1 changed files with 16 additions and 13 deletions
|
@ -97,19 +97,22 @@ class TorrentNotification:
|
||||||
|
|
||||||
def show_notification(self, event):
|
def show_notification(self, event):
|
||||||
if not deluge.common.windows_check():
|
if not deluge.common.windows_check():
|
||||||
import pynotify
|
try:
|
||||||
file_info = self.interface.manager.get_torrent_file_info(event['unique_ID'])
|
import pynotify
|
||||||
filelist = ""
|
except:
|
||||||
for file in file_info[:10]:
|
pass
|
||||||
filelist += file['path'] + "\n"
|
else:
|
||||||
if len(file_info) > 10:
|
file_info = self.interface.manager.get_torrent_file_info(event['unique_ID'])
|
||||||
filelist += '...'
|
filelist = ""
|
||||||
|
for file in file_info[:10]:
|
||||||
if pynotify.init("Deluge"):
|
filelist += file['path'] + "\n"
|
||||||
n = pynotify.Notification(_("Torrent complete"),
|
if len(file_info) > 10:
|
||||||
_("Files") + ":\n" + filelist)
|
filelist += '...'
|
||||||
n.set_icon_from_pixbuf(deluge.common.get_logo(48))
|
if pynotify.init("Deluge"):
|
||||||
n.show()
|
n = pynotify.Notification(_("Torrent complete"),
|
||||||
|
_("Files") + ":\n" + filelist)
|
||||||
|
n.set_icon_from_pixbuf(deluge.common.get_logo(48))
|
||||||
|
n.show()
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue