Skip to content

Commit

Permalink
[viewtsv] fix missing import and argument to open_tsv
Browse files Browse the repository at this point in the history
Fixes:
`NameError: name 'VisiData' is not defined`
and 

```
    run(*(open_tsv(Path(fn)) for fn in sys.argv[1:]))
          ^^^^^^^^^^^^^^^^^^
TypeError: open_tsv() missing 1 required positional argument: 'p'
```
  • Loading branch information
tavisrudd committed May 22, 2024
1 parent 033c65c commit 1ece22d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/viewtsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# as plugin: `from viewtsv import open_tsv` in .visidatarc
# standalone: `viewtsv.py <tsv-files>'

from visidata import Sheet, ColumnItem, asyncthread, options
from visidata import VisiData, Sheet, ColumnItem, asyncthread, options

@VisiData.api
def open_tsv(vd, p):
Expand Down Expand Up @@ -37,5 +37,5 @@ def reload(self):
# a minimal main() for standalone apps
if __name__ == '__main__':
import sys
from visidata import run, Path
run(*(open_tsv(Path(fn)) for fn in sys.argv[1:]))
from visidata import run, Path, vd
run(*(vd.open_tsv(Path(fn)) for fn in sys.argv[1:]))

0 comments on commit 1ece22d

Please sign in to comment.