diff --git a/visidata/pivot.py b/visidata/pivot.py index b3088176c..717e8648c 100644 --- a/visidata/pivot.py +++ b/visidata/pivot.py @@ -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 diff --git a/visidata/pyobj.py b/visidata/pyobj.py index 709137857..ba8d5c9e6 100644 --- a/visidata/pyobj.py +++ b/visidata/pyobj.py @@ -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) diff --git a/visidata/save.py b/visidata/save.py index b88f9bc7b..b2cda646e 100644 --- a/visidata/save.py +++ b/visidata/save.py @@ -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) @@ -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 @@ -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(): @@ -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 diff --git a/visidata/threads.py b/visidata/threads.py index 6fdc39f64..97bbbd449 100644 --- a/visidata/threads.py +++ b/visidata/threads.py @@ -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')