Skip to content

Commit

Permalink
[feature] add Sheet.knownCols #1488
Browse files Browse the repository at this point in the history
  • Loading branch information
saulpw committed Nov 1, 2023
1 parent 116b707 commit aba4efc
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions visidata/features/known_cols.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'''#1488
Usage (in .visidatarc):
DirSheet.knownCols.directory.width = 0
Sheet.knownCols.date.type = date
'''

from visidata import Sheet, DefaultAttrDict


Sheet.knownCols = DefaultAttrDict()


@Sheet.before
def afterLoad(sheet):
for colname, attrs in sheet.knownCols.items():
col = sheet.colsByName.get(colname)
if col:
for k, v in attrs.items():
setattr(col, k, v)

0 comments on commit aba4efc

Please sign in to comment.