Пример #1
0
 def list_artifacts(self, path=None):
     artifact_dir = self.artifact_uri
     list_dir = build_path(artifact_dir, path) if path else artifact_dir
     artifact_files = list_all(list_dir, full_path=True)
     return [
         get_file_info(f, get_relative_path(artifact_dir, f))
         for f in artifact_files
     ]
Пример #2
0
 def list_artifacts(self, path=None):
     artifact_dir = self.artifact_uri
     list_dir = build_path(artifact_dir, path) if path else artifact_dir
     artifact_files = list_all(list_dir, full_path=True)
     infos = [
         get_file_info(f, get_relative_path(artifact_dir, f))
         for f in artifact_files
     ]
     return sorted(infos, key=lambda f: f.path)
Пример #3
0
 def list_artifacts(self, path=None):
     artifact_dir = self.artifact_uri
     list_dir = self.get_path_module().join(artifact_dir, path) if path else artifact_dir
     if self.get_path_module().isdir(list_dir):
         artifact_files = list_all(list_dir, full_path=True)
         infos = [get_file_info(f, self.get_path_module().relpath(f, artifact_dir))
                  for f in artifact_files]
         return sorted(infos, key=lambda f: f.path)
     else:
         return []
Пример #4
0
 def list_artifacts(self, path=None):
     # NOTE: The path is expected to be in posix format.
     # Posix paths work fine on windows but just in case we normalize it here.
     if path:
         path = os.path.normpath(path)
     list_dir = os.path.join(self.artifact_dir, path) if path else self.artifact_dir
     if os.path.isdir(list_dir):
         artifact_files = list_all(list_dir, full_path=True)
         infos = [get_file_info(f,
                                relative_path_to_artifact_path(
                                    os.path.relpath(f, self.artifact_dir)))
                  for f in artifact_files]
         return sorted(infos, key=lambda f: f.path)
     else:
         return []