From b9ff91b6e9008326e3134e47cf3f560e0e90999b Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 26 Oct 2010 06:30:27 +0000 Subject: [PATCH] update of beep --- lib/core/common.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index b38061b76..cda32c2b9 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1506,13 +1506,20 @@ def beep(): if sys.platform == 'linux2': try: - audio = file('/dev/audio', 'wb') + if os.path.exists('/dev/audio'): + audio = file('/dev/audio', 'wb') - for i in xrange(250): - audio.write(chr(32) * 4) - audio.write(chr(0) * 4) + for i in xrange(250): + audio.write(chr(32) * 4) + audio.write(chr(0) * 4) - audio.close() + audio.close() + else: + import curses + + curses.initscr() + curses.beep() + curses.endwin() except: dataToStdout('\a', True) else: