Skip to content

Commit

Permalink
[help] add titles to HELPTODO stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
saulpw committed Nov 5, 2023
1 parent e6a5b5a commit 56f1b7d
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion visidata/aggregators.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from visidata import Progress, Sheet, Column, ColumnsSheet, VisiData
from visidata import vd, anytype, vlen, asyncthread, wrapply, AttrDict

vd.help_aggregators = 'HELPTODO'
vd.help_aggregators = '# Aggregators Help\nHELPTODO'

vd.option('null_value', None, 'a value to be counted as null', replay=True)

Expand Down
2 changes: 1 addition & 1 deletion visidata/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

__all__ = ['ColorAttr', 'colors', 'update_attr', 'ColorMaker', 'rgb_to_attr']

vd.help_color = 'HELPTODO'
vd.help_color = '# Color Help\nHELPTODO'


@dataclass
Expand Down
3 changes: 3 additions & 0 deletions visidata/features/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

from visidata import vd, VisiData, asyncthread, Sheet, Progress, IndexSheet, Column, CellColorizer, ColumnItem, SubColumnItem, TypedWrapper, ColumnsSheet, AttrDict

vd.help_join = '# Join Help\nHELPTODO'

@VisiData.api
def ensureLoaded(vd, sheets):
threads = [vs.ensureLoaded() for vs in sheets]
Expand Down Expand Up @@ -364,6 +366,7 @@ def _fmt_aggr_summary(match, row, trigger_key):
vd.jointypes,
value_key='key',
formatter=_fmt_aggr_summary,
help=vd.help_join,
type='jointype')


Expand Down
4 changes: 2 additions & 2 deletions visidata/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from visidata import vd
from visidata import VisiData, Progress

vd.help_encoding = 'HELPTODO'
vd.help_encoding_errors = 'HELPTODO'
vd.help_encoding = '# Encoding\nHELPTODO'
vd.help_encoding_errors = '# Encoding Errors\nHELPTODO'

vd.option('encoding', 'utf-8-sig', 'encoding passed to codecs.open when reading a file', replay=True, help=vd.help_encoding)
vd.option('encoding_errors', 'surrogateescape', 'encoding_errors passed to codecs.open', replay=True, help=vd.help_encoding_errors)
Expand Down
18 changes: 9 additions & 9 deletions visidata/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@

VisiData.init('searchContext', dict) # [(regex, columns, backward)] -> kwargs from previous search

vd.help_regex_flags = '''# regex flags
- `A` (ASCII) ASCII-only matching (not unicode)
- `I` (IGNORECASE): case-insensitive matching
- `M` (MULTILINE): `^` and `$` match after/before newlines
- `S` (DOTALL): `.` match any character at all, including newline
- `X` (VERBOSE): allow verbose regex
'''


@VisiData.api
@asyncthread
def moveRegex(vd, sheet, *args, **kwargs):
Expand Down Expand Up @@ -61,15 +70,6 @@ def findMatchingColumn(sheet, row, columns, func):
vd.status('%s matches for /%s/' % (matchingRowIndexes, regex.pattern))


vd.help_regex_flags = '''# regex flags
- `A` (ASCII) ASCII-only matching (not unicode)
- `I` (IGNORECASE): case-insensitive matching
- `M` (MULTILINE): `^` and `$` match after/before newlines
- `S` (DOTALL): `.` match any character at all, including newline
- `X` (VERBOSE): allow verbose regex
'''

@Sheet.api
def searchInputRegex(sheet, action:str, columns:str='cursorCol'):
r = vd.inputMultiple(regex=dict(prompt=f"{action} regex: ", type="regex", defaultLast=True, help=vd.help_regex),
Expand Down
2 changes: 1 addition & 1 deletion visidata/text_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from visidata import vd, BaseSheet

vd.help_regex = 'HELPTODO'
vd.help_regex = '# Regex Help\nHELPTODO'

vd.option('regex_skip', '', 'regex of lines to skip in text sources', help=vd.help_regex)

Expand Down

0 comments on commit 56f1b7d

Please sign in to comment.