Пример #1
0
 def createDirectory(self, i):
     if collection_uuid_pattern.match(i['uuid']):
         return CollectionDirectory(self.inode, self.inodes, self.api, self.num_retries, i)
     elif group_uuid_pattern.match(i['uuid']):
         return ProjectDirectory(self.inode, self.inodes, self.api, self.num_retries, i, self._poll, self._poll_time)
     elif link_uuid_pattern.match(i['uuid']):
         if i['head_kind'] == 'arvados#collection' or portable_data_hash_pattern.match(i['head_uuid']):
             return CollectionDirectory(self.inode, self.inodes, self.api, self.num_retries, i['head_uuid'])
         else:
             return None
     elif uuid_pattern.match(i['uuid']):
         return ObjectFile(self.parent_inode, i)
     else:
         return None
Пример #2
0
 def createDirectory(self, i):
     if collection_uuid_pattern.match(i['uuid']):
         return CollectionDirectory(self.inode, self.inodes, self.api, self.num_retries, i)
     elif group_uuid_pattern.match(i['uuid']):
         return ProjectDirectory(self.inode, self.inodes, self.api, self.num_retries, i, self._poll, self._poll_time)
     elif link_uuid_pattern.match(i['uuid']):
         if i['head_kind'] == 'arvados#collection' or portable_data_hash_pattern.match(i['head_uuid']):
             return CollectionDirectory(self.inode, self.inodes, self.api, self.num_retries, i['head_uuid'])
         else:
             return None
     elif uuid_pattern.match(i['uuid']):
         return ObjectFile(self.parent_inode, i)
     else:
         return None
Пример #3
0
 def namefn(self, i):
     if 'name' in i:
         if i['name'] is None or len(i['name']) == 0:
             return None
         elif "uuid" in i and (collection_uuid_pattern.match(i['uuid']) or group_uuid_pattern.match(i['uuid'])):
             # collection or subproject
             return i['name']
         elif link_uuid_pattern.match(i['uuid']) and i['head_kind'] == 'arvados#collection':
             # name link
             return i['name']
         elif 'kind' in i and i['kind'].startswith('arvados#'):
             # something else
             return "{}.{}".format(i['name'], i['kind'][8:])
     else:
         return None
Пример #4
0
 def namefn(i):
     if 'name' in i:
         if i['name'] is None or len(i['name']) == 0:
             return None
         elif collection_uuid_pattern.match(i['uuid']) or group_uuid_pattern.match(i['uuid']):
             # collection or subproject
             return i['name']
         elif link_uuid_pattern.match(i['uuid']) and i['head_kind'] == 'arvados#collection':
             # name link
             return i['name']
         elif 'kind' in i and i['kind'].startswith('arvados#'):
             # something else
             return "{}.{}".format(i['name'], i['kind'][8:])
     else:
         return None
Пример #5
0
 def namefn(i):
     if "name" in i:
         if i["name"] is None or len(i["name"]) == 0:
             return None
         elif collection_uuid_pattern.match(i["uuid"]) or group_uuid_pattern.match(i["uuid"]):
             # collection or subproject
             return i["name"]
         elif link_uuid_pattern.match(i["uuid"]) and i["head_kind"] == "arvados#collection":
             # name link
             return i["name"]
         elif "kind" in i and i["kind"].startswith("arvados#"):
             # something else
             return "{}.{}".format(i["name"], i["kind"][8:])
     else:
         return None