Skip to content

Commit

Permalink
[sort-] renamed self to sheet #2295
Browse files Browse the repository at this point in the history
  • Loading branch information
saulpw committed Feb 23, 2024
1 parent ad494fe commit df09830
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions visidata/sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ def __lt__(self, other):
@Sheet.cached_property
def ordering(sheet) -> 'list[tuple[Column, bool]]':
ret = []
for col, reverse in self._ordering:
for col, reverse in sheet._ordering:
if isinstance(col, str):
col = self.column(col)
col = sheet.column(col)
ret.append((col, reverse))
return ret


@Sheet.api
def sortkey(sheet, r, ordering:'list[tuple[Column, bool]]'=[]):
ret = []
for col, reverse in (ordering or self.ordering):
for col, reverse in (ordering or sheet.ordering):
val = col.getTypedValue(r)
ret.append(Reversor(val) if reverse else val)

Expand Down

0 comments on commit df09830

Please sign in to comment.