borgbackup/src/borg/fuse_impl.py
Thomas Waldmann 3017701958
simplify flake8 configuration
we use black since a while, so some stuff does not need to be ignored any more.
2023-07-25 23:56:31 +02:00

36 lines
874 B
Python

"""
load library for lowlevel FUSE implementation
"""
import os
BORG_FUSE_IMPL = os.environ.get("BORG_FUSE_IMPL", "pyfuse3,llfuse")
for FUSE_IMPL in BORG_FUSE_IMPL.split(","):
FUSE_IMPL = FUSE_IMPL.strip()
if FUSE_IMPL == "pyfuse3":
try:
import pyfuse3 as llfuse
except ImportError:
pass
else:
has_llfuse = False
has_pyfuse3 = True
break
elif FUSE_IMPL == "llfuse":
try:
import llfuse
except ImportError:
pass
else:
has_llfuse = True
has_pyfuse3 = False
break
elif FUSE_IMPL == "none":
pass
else:
raise RuntimeError("unknown fuse implementation in BORG_FUSE_IMPL: '%s'" % BORG_FUSE_IMPL)
else:
llfuse = None # noqa
has_llfuse = False
has_pyfuse3 = False