import argparse
import curses
-import os
import pkg_resources
from random import shuffle
import sys
-from . import parse, progress
+from . import parse, progress, config
from .display import Display, CursesError
from .deck import Status
return parser.parse_args()
-def show(args, stack, headers, input_file):
+def show(args, stack, headers, conf):
"""
Get objects from cache, manipulate deck according to passed arguments, and
send it to the display functions
stack.reverse()
# Send to display
- win = Display(stack, headers, idx, args.view, input_file)
+ win = Display(stack, headers, idx, args.view, args, conf)
try:
curses.wrapper(win.run)
except curses.error as e:
def main(args=sys.argv):
- sys.tracebacklimit = 0
args = parse_args()
global headers, stack
(headers, stack) = parse.parse_html(parse.md2html(args.inp[0]))
- show(args, stack, headers, args)
+ conf = config.read_file(args.config)
+
+ if not conf["debug"]:
+ sys.tracebacklimit = 0
+
+ show(args, stack, headers, conf)
if __name__ == "__main__":