gui.editor.editor_name

gui.editor.editor_name(template='')

The name of the editor a template starts, for a button label.

Parameters

Name Type Description Default
template str An editor template, or an empty string for default_template. ''

Returns

Name Type Description
str str "VS Code", "MacVim", "Vim" or the name of the program the template starts. An unusable template gives "editor".

Examples

from spotregen.gui.editor import PRESETS, editor_name

print([editor_name(PRESETS[name]) for name in PRESETS])
print(editor_name("emacs +{line} {file}"), editor_name("'unbalanced"))
['VS Code', 'Vim', 'MacVim', 'Vim']
emacs editor