3 from arvados.fuse import *
5 if __name__ == '__main__':
6 # Handle command line parameters
7 parser = argparse.ArgumentParser(
8 description='Mount Keep data under the local filesystem.')
9 parser.add_argument('mountpoint', type=str, help="""Mount point.""")
10 parser.add_argument('--collection', type=str, help="""Collection locator""")
11 parser.add_argument('--debug', action='store_true', help="""Debug mode""")
13 args = parser.parse_args()
15 # Create the request handler
16 operations = Operations(os.getuid(), os.getgid())
18 if args.collection != None:
19 # Set up the request handler with the collection at the root
20 e = operations.inodes.add_entry(Directory(llfuse.ROOT_INODE))
21 operations.inodes.load_collection(e, arvados.CollectionReader(arvados.Keep.get(args.collection)))
23 # Set up the request handler with the 'magic directory' at the root
24 operations.inodes.add_entry(MagicDirectory(llfuse.ROOT_INODE, operations.inodes))
26 # FUSE options, see mount.fuse(8)
29 # Enable FUSE debugging (logs each FUSE request)
33 # Initialize the fuse connection
34 llfuse.init(operations, args.mountpoint, opts)
40 # llfuse.close(unmount=True)
43 #llfuse.close(unmount=True)