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

Function loadHistory

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

Source from the content-addressed store, hash-verified

84 pass
85
86def loadHistory(completion=None):
87 if not readlineAvailable():
88 return
89
90 clearHistory()
91
92 if completion == AUTOCOMPLETE_TYPE.SQL:
93 historyPath = paths.SQL_SHELL_HISTORY
94 elif completion == AUTOCOMPLETE_TYPE.OS:
95 historyPath = paths.OS_SHELL_HISTORY
96 elif completion == AUTOCOMPLETE_TYPE.API:
97 historyPath = paths.API_SHELL_HISTORY
98 else:
99 historyPath = paths.SQLMAP_SHELL_HISTORY
100
101 if os.path.exists(historyPath):
102 try:
103 readline.read_history_file(historyPath)
104 except IOError as ex:
105 warnMsg = "there was a problem loading the history file '%s' (%s)" % (historyPath, getSafeExString(ex))
106 logger.warning(warnMsg)
107 except UnicodeError:
108 if IS_WIN:
109 warnMsg = "there was a problem loading the history file '%s'. " % historyPath
110 warnMsg += "More info can be found at 'https://github.com/pyreadline/pyreadline/issues/30'"
111 logger.warning(warnMsg)
112
113def autoCompletion(completion=None, os=None, commands=None):
114 if not readlineAvailable():

Callers 2

cmdLineParserFunction · 0.90
autoCompletionFunction · 0.85

Calls 3

getSafeExStringFunction · 0.90
readlineAvailableFunction · 0.85
clearHistoryFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…