MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / saveHistory

Function saveHistory

lib/core/shell.py:57–84  ·  view source on GitHub ↗
(completion=None)

Source from the content-addressed store, hash-verified

55 readline.clear_history()
56
57def saveHistory(completion=None):
58 try:
59 if not readlineAvailable():
60 return
61
62 if completion == AUTOCOMPLETE_TYPE.SQL:
63 historyPath = paths.SQL_SHELL_HISTORY
64 elif completion == AUTOCOMPLETE_TYPE.OS:
65 historyPath = paths.OS_SHELL_HISTORY
66 elif completion == AUTOCOMPLETE_TYPE.API:
67 historyPath = paths.API_SHELL_HISTORY
68 else:
69 historyPath = paths.SQLMAP_SHELL_HISTORY
70
71 try:
72 with open(historyPath, "w+"):
73 pass
74 except:
75 pass
76
77 readline.set_history_length(MAX_HISTORY_LENGTH)
78 try:
79 readline.write_history_file(historyPath)
80 except IOError as ex:
81 warnMsg = "there was a problem writing the history file '%s' (%s)" % (historyPath, getSafeExString(ex))
82 logger.warning(warnMsg)
83 except KeyboardInterrupt:
84 pass
85
86def loadHistory(completion=None):
87 if not readlineAvailable():

Callers 1

cmdLineParserFunction · 0.90

Calls 2

getSafeExStringFunction · 0.90
readlineAvailableFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…