(completion=None)
| 84 | pass |
| 85 | |
| 86 | def 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 | |
| 113 | def autoCompletion(completion=None, os=None, commands=None): |
| 114 | if not readlineAvailable(): |
no test coverage detected
searching dependent graphs…