()
| 14 | BEEP_WAV_FILENAME = os.path.join(os.path.dirname(__file__), "beep.wav") |
| 15 | |
| 16 | def beep(): |
| 17 | try: |
| 18 | if sys.platform.startswith("win"): |
| 19 | _win_wav_play(BEEP_WAV_FILENAME) |
| 20 | elif sys.platform.startswith("darwin"): |
| 21 | _mac_wav_play(BEEP_WAV_FILENAME) |
| 22 | elif sys.platform.startswith("cygwin"): |
| 23 | _cygwin_beep(BEEP_WAV_FILENAME) |
| 24 | elif any(sys.platform.startswith(_) for _ in ("linux", "freebsd")): |
| 25 | _linux_wav_play(BEEP_WAV_FILENAME) |
| 26 | else: |
| 27 | _speaker_beep() |
| 28 | except: |
| 29 | _speaker_beep() |
| 30 | |
| 31 | def _speaker_beep(): |
| 32 | sys.stdout.write('\a') # doesn't work on modern Linux systems |
no test coverage detected
searching dependent graphs…