diff options
author | Ian Ward <ian@excess.org> | 2012-07-21 15:12:27 -0400 |
---|---|---|
committer | Ian Ward <ian@excess.org> | 2012-07-21 15:12:27 -0400 |
commit | 6dc4f282fbd0fa83cd4cc6b7d7a7ce1bca638ff3 (patch) | |
tree | 5587df1cd0d77122dffed707551c91e5d171707a | |
parent | 527ddf8d0f820d79e741271b86cf3c5c95a4fb2e (diff) | |
download | urwid-6dc4f282fbd0fa83cd4cc6b7d7a7ce1bca638ff3.tar.gz |
add Makefile for generating tutorial screenshots
--HG--
branch : feature-sphinx
-rw-r--r-- | docs/Makefile | 12 | ||||
-rwxr-xr-x | docs/tools/compile_pngs.sh | 8 | ||||
-rw-r--r-- | docs/tutorial/lbscr.py | 4 | ||||
l--------- | docs/tutorial/urwid | 1 |
4 files changed, 19 insertions, 6 deletions
diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..98e6d82 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,12 @@ + +PYTHON_SOURCE=$(shell echo tutorial/*.py.xdotool) +TARGETS=${PYTHON_SOURCE:.py.xdotool=1.png} +TOOLS=tools/compile_pngs.sh tools/screenshots.sh + +.PHONY: all + +all: ${TARGETS} + +${TARGETS}: %1.png: %.py %.py.xdotool ${TOOLS} + echo zzz $< + tools/compile_pngs.sh $< diff --git a/docs/tools/compile_pngs.sh b/docs/tools/compile_pngs.sh index 5a77d5f..2cb5368 100755 --- a/docs/tools/compile_pngs.sh +++ b/docs/tools/compile_pngs.sh @@ -1,9 +1,9 @@ #!/bin/bash -e -# $1: directory to compile -# $2: compiler +# args: scripts to capture DISPLAYNUM=1 +SCREENSHOTS=`dirname $0`/screenshots.sh XVFB=$(which Xvfb) if [ -n $XVFB ]; then @@ -13,8 +13,8 @@ if [ -n $XVFB ]; then trap "kill $XVFBPID" EXIT fi -for script in $1/*.py; do +for script in $@; do if [ -f "${script}.xdotool" ]; then - "$2" "$script" < "${script}.xdotool" + "$SCREENSHOTS" "$script" < "${script}.xdotool" fi done diff --git a/docs/tutorial/lbscr.py b/docs/tutorial/lbscr.py index c2c3b53..b7af105 100644 --- a/docs/tutorial/lbscr.py +++ b/docs/tutorial/lbscr.py @@ -15,10 +15,10 @@ palette = [('header', 'white', 'black'), content = urwid.SimpleListWalker([ urwid.AttrMap(w, None, 'reveal focus') for w in [ urwid.Text(u"This is a text string that is fairly long"), - urwid.Divider(u"-"), + urwid.Divider(u"-"),] + [ urwid.Text(u"Short one"), urwid.Text(u"Another"), - urwid.Divider(u"-"), + urwid.Divider(u"-"), ] * 10 + [ urwid.Text(u"What could be after this?"), urwid.Text(u"The end."),]]) listbox = urwid.ListBox(content) diff --git a/docs/tutorial/urwid b/docs/tutorial/urwid new file mode 120000 index 0000000..2657fa1 --- /dev/null +++ b/docs/tutorial/urwid @@ -0,0 +1 @@ +../../urwid
\ No newline at end of file |