Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbca0cb7

Browse files
committed
Improved documentation on Actor and Blob
1 parent4c39f9d commitbca0cb7

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

‎lib/git/actor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
importre
88

99
classActor(object):
10+
"""Actors hold information about a person acting on the repository. They
11+
can be committers and authors or anything with a name and an email as
12+
mentioned in the git log entries."""
1013
def__init__(self,name,email):
1114
self.name=name
1215
self.email=email

‎lib/git/blob.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
fromcommitimportCommit
1313

1414
classBlob(object):
15+
"""A Blob encapsulates a git blob object"""
1516
DEFAULT_MIME_TYPE="text/plain"
1617

1718
def__init__(self,repo,id,mode=None,name=None):
@@ -48,6 +49,9 @@ def size(self):
4849
4950
Returns
5051
int
52+
53+
NOTE
54+
The size will be cached after the first access
5155
"""
5256
ifself._sizeisNone:
5357
self._size=int(self.repo.git.cat_file(self.id,s=True).rstrip())
@@ -60,6 +64,9 @@ def data(self):
6064
6165
Returns
6266
str
67+
68+
NOTE
69+
The data will be cached after the first access.
6370
"""
6471
self.data_stored=self.data_storedorself.repo.git.cat_file(self.id,p=True,with_raw_output=True)
6572
returnself.data_stored
@@ -71,6 +78,9 @@ def mime_type(self):
7178
7279
Returns
7380
str
81+
82+
NOTE
83+
Defaults to 'text/plain' in case the actual file type is unknown.
7484
"""
7585
guesses=None
7686
ifself.name:
@@ -79,6 +89,10 @@ def mime_type(self):
7989

8090
@property
8191
defbasename(self):
92+
"""
93+
Returns
94+
The basename of the Blobs file name
95+
"""
8296
returnos.path.basename(self.name)
8397

8498
@classmethod
@@ -88,6 +102,9 @@ def blame(cls, repo, commit, file):
88102
89103
Returns
90104
list: [git.Commit, list: [<line>]]
105+
A list of tuples associating a Commit object with a list of lines that
106+
changed within the given commit. The Commit objects will be given in order
107+
of appearance.
91108
"""
92109
data=repo.git.blame(commit,'--',file,p=True)
93110
commits= {}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp