Exemplo n.º 1
0
 def glob_file(self, commit, pattern):
     req = proto.GlobFileRequest(commit=commit_from(commit),
                                 pattern=pattern)
     res = self.stub.GlobFile(req, metadata=self.metadata)
     if hasattr(res, 'file_info'):
         return res.file_info
     return []
Exemplo n.º 2
0
    def glob_file(self, commit, pattern):
        """
        Lists files that match a glob pattern. Yields `FileInfo` objects.
        Params:
        * commit: A tuple, string, or `Commit` object representing the commit.
        * pattern: A string representing a glob pattern.
        """

        req = proto.GlobFileRequest(commit=commit_from(commit),
                                    pattern=pattern)
        return self.stub.GlobFileStream(req, metadata=self.metadata)