mirror of
https://github.com/robmcmullen/atrcopy.git
synced 2025-01-09 01:30:30 +00:00
Added get_first_comment convenience method
This commit is contained in:
parent
5266c5837d
commit
76b656ad88
@ -273,6 +273,11 @@ class DefaultSegment(object):
|
|||||||
rawindex = self.get_raw_index(index)
|
rawindex = self.get_raw_index(index)
|
||||||
return self.rawdata.comments.get(rawindex, "")
|
return self.rawdata.comments.get(rawindex, "")
|
||||||
|
|
||||||
|
def get_first_comment(self, ranges):
|
||||||
|
start = reduce(min, [r[0] for r in ranges])
|
||||||
|
rawindex = self.get_raw_index(start)
|
||||||
|
return self.rawdata.comments.get(rawindex, "")
|
||||||
|
|
||||||
def clear_comment(self, ranges):
|
def clear_comment(self, ranges):
|
||||||
self.clear_style_ranges(ranges, comment=True)
|
self.clear_style_ranges(ranges, comment=True)
|
||||||
for start, end in ranges:
|
for start, end in ranges:
|
||||||
|
Loading…
Reference in New Issue
Block a user