mirror of
https://git.deluge-torrent.org/deluge
synced 2025-10-01 14:38:34 +00:00
got pygame working on windows, so we no longer need this windows check
This commit is contained in:
parent
6195627caf
commit
9f69cccd02
1 changed files with 12 additions and 13 deletions
|
@ -87,21 +87,20 @@ class Notification:
|
||||||
|
|
||||||
def sound(self):
|
def sound(self):
|
||||||
"""plays a sound when a torrent finishes"""
|
"""plays a sound when a torrent finishes"""
|
||||||
if not deluge.common.windows_check():
|
try:
|
||||||
|
import pygame
|
||||||
|
except:
|
||||||
|
log.warning("pygame is not installed")
|
||||||
|
else:
|
||||||
|
pygame.init()
|
||||||
try:
|
try:
|
||||||
import pygame
|
alert_sound = pygame.mixer.music
|
||||||
except:
|
alert_sound.load(self.config["ntf_sound_path"])
|
||||||
log.warning("pygame is not installed")
|
alert_sound.play()
|
||||||
|
except pygame.error, message:
|
||||||
|
log.warning("pygame failed to play because %s" % (message))
|
||||||
else:
|
else:
|
||||||
pygame.init()
|
log.info("sound notification played successfully")
|
||||||
try:
|
|
||||||
alert_sound = pygame.mixer.music
|
|
||||||
alert_sound.load(self.config["ntf_sound_path"])
|
|
||||||
alert_sound.play()
|
|
||||||
except pygame.error, message:
|
|
||||||
log.warning("pygame failed to play because %s" % (message))
|
|
||||||
else:
|
|
||||||
log.info("sound notification played successfully")
|
|
||||||
|
|
||||||
def email(self, status):
|
def email(self, status):
|
||||||
"""sends email notification of finished torrent"""
|
"""sends email notification of finished torrent"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue