diff --git a/chapters.py b/chapters.py deleted file mode 100644 index e4bd540..0000000 --- a/chapters.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python -from __future__ import print_function, unicode_literals -import sys - -task_templates = [ - "read {}", - "make chapter summary for {}", - "make flashcards for {}", -] - -for line in sys.stdin.readlines(): - for template in task_templates: - print(template.format(line.strip())) diff --git a/chapters.sh b/chapters.sh deleted file mode 100755 index 4f9cf17..0000000 --- a/chapters.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -seq 1 ${1} | tr ' ' '\n' | sed -E 's/^/chapter /g' | python chapters.py diff --git a/occasional-scripts/chapters.py b/occasional-scripts/chapters.py new file mode 100644 index 0000000..c8eb26b --- /dev/null +++ b/occasional-scripts/chapters.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +from __future__ import print_function, unicode_literals +import argparse + +parser = argparse.ArgumentParser() +parser.add_argument('num_chapters', type=int) +args = parser.parse_args() + +task_templates = [ + "read chapter {}", + "make chapter summary for chapter {}", + "make flashcards for chapter {}", +] + +for i in range(1, args.num_chapters+1): + for template in task_templates: + print(template.format(i))