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