mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
sqlite3: optional loading (#5534)
After testing xonsh on ALT linux (https://github.com/xonsh/xonsh/issues/5517#issuecomment-2187069017) I see that we need to make sqlite3 loading optional. ## For community ⬇️ **Please click the 👍 reaction instead of leaving a `+1` or 👍 comment** --------- Co-authored-by: a <1@1.1> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
934351254a
commit
3e41a744d4
1 changed files with 13 additions and 2 deletions
|
@ -15,9 +15,20 @@ from xonsh.built_ins import XSH
|
||||||
from xonsh.history.base import History
|
from xonsh.history.base import History
|
||||||
from xonsh.history.dummy import DummyHistory
|
from xonsh.history.dummy import DummyHistory
|
||||||
from xonsh.history.json import JsonHistory
|
from xonsh.history.json import JsonHistory
|
||||||
from xonsh.history.sqlite import SqliteHistory
|
|
||||||
|
|
||||||
HISTORY_BACKENDS = {"dummy": DummyHistory, "json": JsonHistory, "sqlite": SqliteHistory}
|
HISTORY_BACKENDS = {"dummy": DummyHistory, "json": JsonHistory}
|
||||||
|
|
||||||
|
try:
|
||||||
|
from xonsh.history.sqlite import SqliteHistory
|
||||||
|
|
||||||
|
HISTORY_BACKENDS |= {"sqlite": SqliteHistory}
|
||||||
|
except Exception:
|
||||||
|
"""
|
||||||
|
On some linux systems (e.g. alt linux) sqlite3 is not installed
|
||||||
|
and it's hard to install it and maybe user can't install it.
|
||||||
|
We need to just go forward.
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def construct_history(backend=None, **kwargs) -> "History":
|
def construct_history(backend=None, **kwargs) -> "History":
|
||||||
|
|
Loading…
Add table
Reference in a new issue