import sys
import textwrap
+from . import lightcards
+
def disp_bar(stdscr, stack, headers, obj):
"""
"i, / star card\n" +
"0, ^, home go to the start of the deck\n" +
"$, end go to the end of the deck\n" +
- "H, ? open this screen\n\n" +
+ "H, ? open this screen\n" +
+ "e open the input file in $EDITOR\n\n" +
"More information can be found in the man page, or by\n" +
"running `lightcards --help`.\n\n" +
"Press [q], [H], or [?] to go back.")
disp_card(stdscr, stack, headers, idx)
elif key in ["H", "?"]:
disp_help(stdscr, stack, headers, idx)
+ elif key == "e":
+ (headers, stack) = lightcards.reparse()
+ get_key(stdscr, stack, headers, idx)
import argparse
from curses import wrapper
+import os
from random import shuffle
import sys
wrapper(display.init_disp, stack, headers, idx)
+def reparse():
+ args = parse_args()
+ os.system(f"$EDITOR {args.inp[0]}"),
+ return parse.parse_html(parse.md2html(args.inp[0]))
+
+
def main(args=sys.argv):
args = parse_args()
(headers, stack) = parse.parse_html(parse.md2html(args.inp[0]))
.TP
\f[B]$\f[R], \f[B]end\f[R]
Go to end of deck
+.TP
+\f[B]H\f[R], \f[B]?\f[R]
+Open help screen
+.TP
+\f[B]e\f[R]
+Open input file in $EDITOR
.SH EXIT VALUES
.TP
\f[B]0\f[R]