Skip to content

Commit

Permalink
set up boilerplate for virtualfs - impl nopfs
Browse files Browse the repository at this point in the history
  • Loading branch information
azuline committed Oct 10, 2023
1 parent e045ed0 commit d0387aa
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
13 changes: 13 additions & 0 deletions rose/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from rose.cache.database import migrate_database
from rose.cache.update import update_cache_for_all_releases
from rose.foundation.conf import Config
from rose.virtualfs import start_virtualfs


@dataclass
Expand Down Expand Up @@ -48,5 +49,17 @@ def clear(c: Context) -> None:
c.config.cache_database_path.unlink()


@cli.group()
def fs() -> None:
"""Manage the virtual library."""


@cli.command()
@click.pass_obj
def mount(c: Context) -> None:
"""Mount the virtual library."""
start_virtualfs(c.config)


if __name__ == "__main__":
cli()
15 changes: 15 additions & 0 deletions rose/virtualfs/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import fuse

from rose.foundation.conf import Config

fuse.fuse_python_api = (0, 2)


class VirtualFS(fuse.Fuse):
pass


def start_virtualfs(c: Config):
server = VirtualFS()
server.parse([str(c.fuse_mount_dir)])
server.main()

0 comments on commit d0387aa

Please sign in to comment.