Skip to content

Commit

Permalink
[experimental] add visidata.experimental import
Browse files Browse the repository at this point in the history
  • Loading branch information
saulpw committed Feb 18, 2023
1 parent 111bc9e commit 9db912c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'windows-curses; platform_system == "Windows"',
'importlib-metadata >= 3.6',
],
packages=['visidata', 'visidata.loaders', 'visidata.vendor', 'visidata.tests', 'visidata.ddw', 'visidata.man', 'visidata.themes', 'visidata.features'],
packages=['visidata', 'visidata.loaders', 'visidata.vendor', 'visidata.tests', 'visidata.ddw', 'visidata.man', 'visidata.themes', 'visidata.features', 'visidata.experimental'],
data_files=[('share/man/man1', ['visidata/man/vd.1', 'visidata/man/visidata.1'])],
package_data={'visidata.man': ['vd.1', 'vd.txt'], 'visidata.ddw': ['input.ddw'], 'visidata.tests': ['sample.tsv']},
license='GPLv3',
Expand Down
1 change: 1 addition & 0 deletions visidata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def getGlobals():
vd.importStar('random')
vd.importStar('itertools')

import visidata.experimental # import nothing by default but make package accessible

vd.finalInit() # call all VisiData.init() from modules

Expand Down
19 changes: 11 additions & 8 deletions visidata/experimental/guide.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
'''
# A Guide to VisiData Guides
Each guide shows you how to use a major feature in VisiData.
{bold}Up/Down{} to move the row cursor
{bold}Enter{} to view a topic
{bold}Backspace{} to come back to this list of guides
'''

import re

from visidata import vd, BaseSheet, Sheet, ItemColumn, Column
from visidata import vd, BaseSheet, Sheet, ItemColumn, Column, VisiData


@VisiData.api
class GuideGuide(Sheet):
help = '''
Each guide shows you how to use a major feature in VisiData.
- {`Up`}/{`Down`} to move the cursor
- {`Enter`} to view a topic
- {`q`} to come back to list of guides
'''
help = __doc__
columns = [
ItemColumn('n', 0, type=int),
ItemColumn('sheetname', 1, width=0),
Expand Down
2 changes: 0 additions & 2 deletions visidata/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ def keys(self, obj=None):
def _get(self, k, obj=None):
'Return Option object for k in context of obj. Cache result until any set().'
opt = self._cache.get((k, obj or vd.activeSheet), None)
# if k == 'disp_sidebar_fmt':
# breakpoint()
if opt is None:
opt = self._opts._get(k, obj)
self._cache[(k, obj or vd.activeSheet)] = opt
Expand Down

0 comments on commit 9db912c

Please sign in to comment.