(mycli: 'MyCli')
| 126 | |
| 127 | |
| 128 | def _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 | |
| 141 | def _show_startup_banner( |
no test coverage detected