will appear if it exists.
""".lstrip()
- def __init__(self, parent_inode, inodes, api, num_retries, by_pdh=False):
+ def __init__(self, parent_inode, inodes, api, num_retries, pdh_only=False):
super(MagicDirectory, self).__init__(parent_inode, inodes)
self.api = api
self.num_retries = num_retries
- self.by_pdh = by_pdh
+ self.pdh_only = pdh_only
def __setattr__(self, name, value):
super(MagicDirectory, self).__setattr__(name, value)
if k in self._entries:
return True
- if self.by_pdh and uuid_pattern.match(k):
- raise llfuse.FUSEError(errno.ENOENT)
-
- if not portable_data_hash_pattern.match(k) and not uuid_pattern.match(k):
+ if not portable_data_hash_pattern.match(k) and (self.pdh_only or not uuid_pattern.match(k)):
return False
try:
mount_mode = parser.add_mutually_exclusive_group()
- mount_mode.add_argument('--all', action='store_true', help="""Mount a subdirectory for each mode: home, shared, by_tag, by_pdh, by_id (default).""")
+ mount_mode.add_argument('--all', action='store_true', help="""Mount a subdirectory for each mode: home, shared, by_tag, by_id (default).""")
mount_mode.add_argument('--home', action='store_true', help="""Mount only the user's home project.""")
mount_mode.add_argument('--shared', action='store_true', help="""Mount only list of projects shared with the user.""")
mount_mode.add_argument('--by-tag', action='store_true',
e = operations.inodes.add_entry(Directory(llfuse.ROOT_INODE, operations.inodes))
dir_args[0] = e.inode
- e._entries['by_id'] = operations.inodes.add_entry(MagicDirectory(*dir_args, by_pdh=True if args.by_pdh else False))
+ e._entries['by_id'] = operations.inodes.add_entry(MagicDirectory(*dir_args, pdh_only=True if args.by_pdh else False))
e._entries['by_tag'] = operations.inodes.add_entry(TagsDirectory(*dir_args))