Skip to content

Commit

Permalink
[import] add imports for pivot, pyobj, save, and threads
Browse files Browse the repository at this point in the history
  • Loading branch information
anjakefala committed Oct 11, 2023
1 parent 99acb5f commit c926696
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
5 changes: 3 additions & 2 deletions visidata/pivot.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import collections
from copy import copy
from visidata import vd, date, ScopedSetattr, Column, Sheet, asyncthread, Progress, forward, wrapply, INPROGRESS
from visidata import *
from visidata import ScopedSetattr, Column, Sheet, asyncthread, Progress, forward, wrapply, INPROGRESS
from visidata import vlen, vd, date
import visidata


# discrete_keys = tuple of formatted discrete keys that group the row
Expand Down
4 changes: 3 additions & 1 deletion visidata/pyobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import inspect
import math

from visidata import *
from visidata import vd, asyncthread, ENTER, anytype, getitemdef
from visidata import Sheet, Column, VisiData, ColumnItem, TableSheet, BaseSheet, Progress, ColumnAttr, SuspendCurses
import visidata

vd.option('visibility', 0, 'visibility level')
vd.option('default_sample_size', 100, 'number of rows to sample for regex.split (0=all)', replay=True)
Expand Down
10 changes: 5 additions & 5 deletions visidata/save.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import collections
from copy import copy

from visidata import *

from visidata import vd
from visidata import Sheet, BaseSheet, VisiData, IndexSheet, Path, Progress, TypedExceptionWrapper

vd.option('confirm_overwrite', True, 'whether to prompt for overwrite confirmation on save')
vd.option('safe_error', '#ERR', 'error string to use while saving', replay=True)
Expand All @@ -11,7 +11,7 @@
@Sheet.api
def safe_trdict(vs):
'returns string.translate dictionary for replacing tabs and newlines'
if options.safety_first:
if vs.options.safety_first:
delim = vs.options.delimiter
return {
0: '', # strip NUL completely
Expand All @@ -38,7 +38,7 @@ def iterdispvals(sheet, *cols, format=False):
if trdict:
transformers[col].append(lambda v,trdict=trdict: v.translate(trdict))

options_safe_error = options.safe_error
options_safe_error = sheet.options.safe_error
for r in Progress(sheet.rows):
dispvals = collections.OrderedDict() # [col] -> value
for col, transforms in transformers.items():
Expand Down Expand Up @@ -99,7 +99,7 @@ def save_cols(vd, cols):
else:
savedcoltxt = '%s columns' % len(cols)
path = vd.inputPath('save %s to: ' % savedcoltxt, value=vs.getDefaultSaveName())
vd.saveSheets(path, vs, confirm_overwrite=options.confirm_overwrite)
vd.saveSheets(path, vs, confirm_overwrite=sheet.options.confirm_overwrite)


@VisiData.api
Expand Down
3 changes: 1 addition & 2 deletions visidata/threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
import curses

from visidata import VisiData, vd, options, globalCommand, Sheet, EscapeException
from visidata import ColumnAttr, Column
from visidata import *
from visidata import ColumnAttr, Column, BaseSheet, ItemColumn


vd.option('profile', False, 'enable profiling on threads')
Expand Down

0 comments on commit c926696

Please sign in to comment.