MCPcopy Create free account
hub / github.com/dbcli/mycli / _create_history

Function _create_history

mycli/main_modes/repl.py:128–138  ·  view source on GitHub ↗
(mycli: 'MyCli')

Source from the content-addressed store, hash-verified

126
127
128def _create_history(mycli: 'MyCli') -> FileHistoryWithTimestamp | None:
129 history_file = os.path.expanduser(os.environ.get('MYCLI_HISTFILE', mycli.config['main'].get('history_file', '~/.mycli-history')))
130 if dir_path_exists(history_file):
131 return FileHistoryWithTimestamp(history_file)
132
133 mycli.echo(
134 f'Error: Unable to open the history file "{history_file}". Your query history will not be saved.',
135 err=True,
136 fg='red',
137 )
138 return None
139
140
141def _show_startup_banner(

Callers 1

main_replFunction · 0.85

Calls 4

dir_path_existsFunction · 0.90
getMethod · 0.45
echoMethod · 0.45

Tested by

no test coverage detected