File: _help.py

package info (click to toggle)
python-mne 0.13.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 92,032 kB
  • ctags: 8,249
  • sloc: python: 84,750; makefile: 205; sh: 15
file content (16 lines) | stat: -rw-r--r-- 538 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
#
# License: BSD (3-clause)
import json
import os
from textwrap import TextWrapper


def read_tooltips(gui_name):
    "Read and format tooltips, return a dict"
    dirname = os.path.dirname(__file__)
    help_path = os.path.join(dirname, 'help', gui_name + '.json')
    with open(help_path) as fid:
        raw_tooltips = json.load(fid)
    format_ = TextWrapper(width=60, fix_sentence_endings=True).fill
    return dict((key, format_(text)) for key, text in raw_tooltips.items())