8000 Provide function to obtain the contents of a PullFile. · charbu01/github3.py@6d36b2c · GitHub
[go: up one dir, main page]

Skip to content

Commit 6d36b2c

Browse files
committed
Provide function to obtain the contents of a PullFile.
1 parent 0f301b2 commit 6d36b2c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

github3/pulls.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def _repr(self):
5050
return '<{0} [{1}]>'.format(self.direction, self.label)
5151

5252

53-
class PullFile(GitHubObject):
53+
class PullFile(GitHubCore):
5454

5555
"""The :class:`PullFile <PullFile>` object.
5656
@@ -80,6 +80,14 @@ def _update_attributes(self, pfile):
8080
def _repr(self):
8181
return '<Pull Request File [{0}]>'.format(self.filename)
8282

83+
def contents(self, stream=False):
84+
"""Return the contents of the raw file.
85+
86+
:param stream: When true, the resulting object can be iterated over via
87+
``iter_contents``.
88+
"""
89+
return self.session.get(self.raw_url, stream=stream)
90+
8391

8492
class PullRequest(GitHubCore):
8593

0 commit comments

Comments
 (0)
0