From 93e8d0c63abd8f32ae5607beac65ab5237768c1b Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Mon, 31 Dec 2018 14:49:01 -0600 Subject: [PATCH] add some utility scripts for making tasks for reading books --- chapters.py | 13 +++++++++++++ chapters.sh | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 chapters.py create mode 100755 chapters.sh diff --git a/chapters.py b/chapters.py new file mode 100644 index 0000000..e4bd540 --- /dev/null +++ b/chapters.py @@ -0,0 +1,13 @@ +#!/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 new file mode 100755 index 0000000..4f9cf17 --- /dev/null +++ b/chapters.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +seq 1 ${1} | tr ' ' '\n' | sed -E 's/^/chapter /g' | python chapters.py