Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yuki
gajim
Commits
959a51c5
Commit
959a51c5
authored
6 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
Dont test if winsound is available
Its a standard library which will be always available in our builds
parent
8061146d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gajim/common/helpers.py
+6
-11
6 additions, 11 deletions
gajim/common/helpers.py
with
6 additions
and
11 deletions
gajim/common/helpers.py
+
6
−
11
View file @
959a51c5
...
...
@@ -62,15 +62,7 @@ except ImportError:
HAS_PRECIS_I18N
=
False
HAS_SOUND
=
True
if
sys
.
platform
==
'
win32
'
:
try
:
import
winsound
# windows-only built-in module for playing wav
except
ImportError
:
HAS_SOUND
=
False
print
(
'
Gajim is not able to playback sound because
'
'
pywin32 is missing
'
,
file
=
sys
.
stderr
)
elif
sys
.
platform
==
'
darwin
'
:
if
sys
.
platform
==
'
darwin
'
:
try
:
from
AppKit
import
NSSound
except
ImportError
:
...
...
@@ -766,12 +758,15 @@ def play_sound_file(path_to_soundfile):
path_to_soundfile
=
check_soundfile_path
(
path_to_soundfile
)
if
path_to_soundfile
is
None
:
return
if
sys
.
platform
==
'
win32
'
and
HAS_SOUND
:
if
sys
.
platform
==
'
win32
'
:
import
winsound
try
:
winsound
.
PlaySound
(
path_to_soundfile
,
winsound
.
SND_FILENAME
|
winsound
.
SND_ASYNC
)
winsound
.
SND_FILENAME
|
winsound
.
SND_ASYNC
)
except
Exception
:
log
.
exception
(
'
Sound Playback Error
'
)
elif
sys
.
platform
==
'
linux
'
:
if
app
.
config
.
get
(
'
soundplayer
'
)
==
''
:
def
_oss_play
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment