Returns the object for a given line given its number in the current Blame. Parameters: line_no Line number, starts at 1.
(self, line_no: int)
| 138 | return BlameHunk._from_c(self, chunk) |
| 139 | |
| 140 | def for_line(self, line_no: int) -> BlameHunk: |
| 141 | """ |
| 142 | Returns the <BlameHunk> object for a given line given its number in the |
| 143 | current Blame. |
| 144 | |
| 145 | Parameters: |
| 146 | |
| 147 | line_no |
| 148 | Line number, starts at 1. |
| 149 | """ |
| 150 | if line_no < 0: |
| 151 | raise IndexError |
| 152 | |
| 153 | chunk = C.git_blame_get_hunk_byline(self._blame, line_no) |
| 154 | if not chunk: |
| 155 | raise IndexError |
| 156 | |
| 157 | return BlameHunk._from_c(self, chunk) |
| 158 | |
| 159 | def __iter__(self) -> Iterator[BlameHunk]: |
| 160 | return GenericIterator(self) |