mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 17:46:37 +03:00
Minor improvements
This commit is contained in:
parent
89a5892dd9
commit
617c336813
|
@ -15,11 +15,13 @@ BEEP_WAV_FILENAME = os.path.join(os.path.dirname(__file__), "beep.wav")
|
||||||
|
|
||||||
def beep():
|
def beep():
|
||||||
try:
|
try:
|
||||||
if sys.platform == "nt":
|
if sys.platform.startswith("win"):
|
||||||
_win_wav_play(BEEP_WAV_FILENAME)
|
_win_wav_play(BEEP_WAV_FILENAME)
|
||||||
elif sys.platform == "darwin":
|
elif sys.platform.startswith("darwin"):
|
||||||
_mac_beep()
|
_mac_beep()
|
||||||
elif sys.platform.startswith("linux"):
|
elif sys.platform.startswith("cygwin"):
|
||||||
|
_cygwin_beep(BEEP_WAV_FILENAME)
|
||||||
|
elif any(sys.platform.startswith(_) for _ in ("linux", "freebsd")):
|
||||||
_linux_wav_play(BEEP_WAV_FILENAME)
|
_linux_wav_play(BEEP_WAV_FILENAME)
|
||||||
else:
|
else:
|
||||||
_speaker_beep()
|
_speaker_beep()
|
||||||
|
@ -34,6 +36,10 @@ def _speaker_beep():
|
||||||
except IOError:
|
except IOError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# Reference: https://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00815.html
|
||||||
|
def _cygwin_beep(filename):
|
||||||
|
os.system("play-sound-file '%s' 2>/dev/null" % filename)
|
||||||
|
|
||||||
def _mac_beep():
|
def _mac_beep():
|
||||||
import Carbon.Snd
|
import Carbon.Snd
|
||||||
Carbon.Snd.SysBeep(1)
|
Carbon.Snd.SysBeep(1)
|
||||||
|
@ -57,7 +63,10 @@ def _linux_wav_play(filename):
|
||||||
class struct_pa_sample_spec(ctypes.Structure):
|
class struct_pa_sample_spec(ctypes.Structure):
|
||||||
_fields_ = [("format", ctypes.c_int), ("rate", ctypes.c_uint32), ("channels", ctypes.c_uint8)]
|
_fields_ = [("format", ctypes.c_int), ("rate", ctypes.c_uint32), ("channels", ctypes.c_uint8)]
|
||||||
|
|
||||||
pa = ctypes.cdll.LoadLibrary("libpulse-simple.so.0")
|
try:
|
||||||
|
pa = ctypes.cdll.LoadLibrary("libpulse-simple.so.0")
|
||||||
|
except OSError:
|
||||||
|
return
|
||||||
|
|
||||||
wave_file = wave.open(filename, "rb")
|
wave_file = wave.open(filename, "rb")
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ from lib.core.enums import OS
|
||||||
from thirdparty.six import unichr as _unichr
|
from thirdparty.six import unichr as _unichr
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||||
VERSION = "1.3.9.6"
|
VERSION = "1.3.9.7"
|
||||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user