Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 617c336

Browse files
committed
Minor improvements
1 parent 89a5892 commit 617c336

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

extra/beep/beep.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515

1616
def beep():
1717
try:
18-
if sys.platform == "nt":
18+
if sys.platform.startswith("win"):
1919
_win_wav_play(BEEP_WAV_FILENAME)
20-
elif sys.platform == "darwin":
20+
elif sys.platform.startswith("darwin"):
2121
_mac_beep()
22-
elif sys.platform.startswith("linux"):
22+
elif sys.platform.startswith("cygwin"):
23+
_cygwin_beep(BEEP_WAV_FILENAME)
24+
elif any(sys.platform.startswith(_) for _ in ("linux", "freebsd")):
2325
_linux_wav_play(BEEP_WAV_FILENAME)
2426
else:
2527
_speaker_beep()
@@ -34,6 +36,10 @@ def _speaker_beep():
3436
except IOError:
3537
pass
3638

39+
# Reference: https://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00815.html
40+
def _cygwin_beep(filename):
41+
os.system("play-sound-file '%s' 2>/dev/null" % filename)
42+
3743
def _mac_beep():
3844
import Carbon.Snd
3945
Carbon.Snd.SysBeep(1)
@@ -57,7 +63,10 @@ def _linux_wav_play(filename):
5763
class struct_pa_sample_spec(ctypes.Structure):
5864
_fields_ = [("format", ctypes.c_int), ("rate", ctypes.c_uint32), ("channels", ctypes.c_uint8)]
5965

60-
pa = ctypes.cdll.LoadLibrary("libpulse-simple.so.0")
66+
try:
67+
pa = ctypes.cdll.LoadLibrary("libpulse-simple.so.0")
68+
except OSError:
69+
return
6170

6271
wave_file = wave.open(filename, "rb")
6372

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.3.9.6"
21+
VERSION = "1.3.9.7"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

0 commit comments

Comments
 (0)