From 589f6fda8e54d5b5ed0ae3b1c25aa7357974ddd3 Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Sat, 30 Jan 2021 22:21:37 -0500 Subject: [PATCH] Update installation Add Makefile shell script, and __main__.py --- Makefile | 5 +++++ README.md | 2 +- lightcards.sh | 2 ++ lightcards/__main__.py | 4 ++++ lightcards/lightcards.py | 3 ++- 5 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 Makefile create mode 100755 lightcards.sh create mode 100644 lightcards/__main__.py diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b0b7362 --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ +.DEFAULT_GOAL := install + +install: + pip install . + cp ./lightcards.sh /usr/local/bin/lightcards diff --git a/README.md b/README.md index 560b692..88c6d73 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Lightcards is a terminal program for using flashcards from a Markdown or HTML table. Currently under development. # Installation -`pip install .` +`make` ## License Copyright Armaan Bhojwani 2021, MIT license diff --git a/lightcards.sh b/lightcards.sh new file mode 100755 index 0000000..10a1657 --- /dev/null +++ b/lightcards.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +python3 -m lightcards ${@} diff --git a/lightcards/__main__.py b/lightcards/__main__.py new file mode 100644 index 0000000..283493d --- /dev/null +++ b/lightcards/__main__.py @@ -0,0 +1,4 @@ +import sys +import lightcards.lightcards + +lightcards.lightcards.main(sys.argv) diff --git a/lightcards/lightcards.py b/lightcards/lightcards.py index 775b13d..62019a5 100755 --- a/lightcards/lightcards.py +++ b/lightcards/lightcards.py @@ -4,6 +4,7 @@ import argparse from curses import wrapper +import sys from . import display, parse from .deck import Status @@ -26,7 +27,7 @@ def show(stack, headers): wrapper(display.get_key, stack, headers, idx) -def main(): +def main(args=sys.argv): args = parse_args() if args.version: print("0.0.0") -- 2.39.2