diff options
| author | marco giusti <marco.giusti@gmail.com> | 2011-12-06 00:34:26 +0100 |
|---|---|---|
| committer | marco giusti <marco.giusti@gmail.com> | 2011-12-06 00:34:26 +0100 |
| commit | aec2740cc698b5b8c7e59cdcd7ab3a05d12716f9 (patch) | |
| tree | a198d3f9194fd6bba18b25dabdc692ff51574c6c /docs | |
| parent | f0f72e2f606b8b3a5189c4d5e637a543708cd07c (diff) | |
| download | urwid-aec2740cc698b5b8c7e59cdcd7ab3a05d12716f9.tar.gz | |
Add screenshots.sh and compile_pngs.sh
Substitute old images with the new ones generated by the new scripts
--HG--
branch : feature-sphinx
Diffstat (limited to 'docs')
43 files changed, 78 insertions, 2 deletions
diff --git a/docs/tools/compile_pngs.sh b/docs/tools/compile_pngs.sh new file mode 100755 index 0000000..b74cc51 --- /dev/null +++ b/docs/tools/compile_pngs.sh @@ -0,0 +1,20 @@ +#!/bin/bash -e + +# $1: directory to compile +DISPLAYNUM=1 + +XVFB=$(which Xvfb) +if [ -n $XVFB ]; then + # Xvfb :$DISPLAYNUM &> /dev/null & + Xvfb :$DISPLAYNUM & + XVFBPID=$! + # DISPLAY=:1 + sleep 0.5 + trap "kill $XVFBPID" EXIT +fi + +for script in $1/*.py; do + if [ -f "${script}.xdotool" ]; then + bash screenshots.sh "$script" < "${script}.xdotool" + fi +done diff --git a/docs/tools/screenshots.sh b/docs/tools/screenshots.sh new file mode 100755 index 0000000..d6d1f62 --- /dev/null +++ b/docs/tools/screenshots.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# $1: python script to run +# urxvt, xdotool and import are required to run this script + +# this should be pretty unique, but a true random classname is still possible +# CLASSNAME=$(head -c 6 /dev/urandom | base64) +CLASSNAME=urwid-screenshot +PYTHON=python + +urxvt -bg gray90 -b 0 +sb -name "$CLASSNAME" -e "$PYTHON" "$1" & +RXVTPID=$! +sleep 0.2 +RXVTWINDOWID=$(xdotool search --classname "$CLASSNAME") +export RXVTWINDOWID +image=${1%.py} + +c=1 +while read -r line; do + # the echo trick is needed to expand RXVTWINDOWID variable + echo $line | xdotool - + import -window "$RXVTWINDOWID" "${image}$c.png" + (( c++ )) +done + +kill $RXVTPID diff --git a/docs/tutorial/attr.py.xdotool b/docs/tutorial/attr.py.xdotool new file mode 100644 index 0000000..ca21a03 --- /dev/null +++ b/docs/tutorial/attr.py.xdotool @@ -0,0 +1,4 @@ +windowsize --usehints $RXVTWINDOWID 21 7 +windowsize --usehints $RXVTWINDOWID 10 9 +windowsize --usehints $RXVTWINDOWID 30 3 +windowsize --usehints $RXVTWINDOWID 15 2 diff --git a/docs/tutorial/attr1.png b/docs/tutorial/attr1.png Binary files differindex 95de174..4a77934 100644 --- a/docs/tutorial/attr1.png +++ b/docs/tutorial/attr1.png diff --git a/docs/tutorial/attr2.png b/docs/tutorial/attr2.png Binary files differindex 306febb..9f2225c 100644 --- a/docs/tutorial/attr2.png +++ b/docs/tutorial/attr2.png diff --git a/docs/tutorial/attr3.png b/docs/tutorial/attr3.png Binary files differindex 2c3932a..16bdf7b 100644 --- a/docs/tutorial/attr3.png +++ b/docs/tutorial/attr3.png diff --git a/docs/tutorial/attr4.png b/docs/tutorial/attr4.png Binary files differindex 4d3c3d0..6db8fc7 100644 --- a/docs/tutorial/attr4.png +++ b/docs/tutorial/attr4.png diff --git a/docs/tutorial/edit.py.xdotool b/docs/tutorial/edit.py.xdotool new file mode 100644 index 0000000..8c07e59 --- /dev/null +++ b/docs/tutorial/edit.py.xdotool @@ -0,0 +1,3 @@ +windowsize --usehints $RXVTWINDOWID 21 7 +type --window $RXVTWINDOWID Arthur,\ King\ of\ the\ Britons +key --window $RXVTWINDOWID Return diff --git a/docs/tutorial/edit1.png b/docs/tutorial/edit1.png Binary files differindex 67b43c1..3589555 100644 --- a/docs/tutorial/edit1.png +++ b/docs/tutorial/edit1.png diff --git a/docs/tutorial/edit2.png b/docs/tutorial/edit2.png Binary files differindex 982ae1f..f7e8144 100644 --- a/docs/tutorial/edit2.png +++ b/docs/tutorial/edit2.png diff --git a/docs/tutorial/edit3.png b/docs/tutorial/edit3.png Binary files differindex 9f9f6b9..57671bb 100644 --- a/docs/tutorial/edit3.png +++ b/docs/tutorial/edit3.png diff --git a/docs/tutorial/frlb.py.xdotool b/docs/tutorial/frlb.py.xdotool new file mode 100644 index 0000000..90cbab1 --- /dev/null +++ b/docs/tutorial/frlb.py.xdotool @@ -0,0 +1,4 @@ +windowsize --usehints $RXVTWINDOWID 21 7 +type --window $RXVTWINDOWID Tim\ t +type --window $RXVTWINDOWID he\ Ench +type --window $RXVTWINDOWID anter diff --git a/docs/tutorial/frlb1.png b/docs/tutorial/frlb1.png Binary files differindex a5aa924..70d6a05 100644 --- a/docs/tutorial/frlb1.png +++ b/docs/tutorial/frlb1.png diff --git a/docs/tutorial/frlb2.png b/docs/tutorial/frlb2.png Binary files differindex d221704..63952d9 100644 --- a/docs/tutorial/frlb2.png +++ b/docs/tutorial/frlb2.png diff --git a/docs/tutorial/frlb3.png b/docs/tutorial/frlb3.png Binary files differindex 70a1540..4fd5701 100644 --- a/docs/tutorial/frlb3.png +++ b/docs/tutorial/frlb3.png diff --git a/docs/tutorial/frlb4.png b/docs/tutorial/frlb4.png Binary files differindex 9adf982..7402002 100644 --- a/docs/tutorial/frlb4.png +++ b/docs/tutorial/frlb4.png diff --git a/docs/tutorial/highcolors.png b/docs/tutorial/highcolors.png Binary files differdeleted file mode 100644 index 0aa90c7..0000000 --- a/docs/tutorial/highcolors.png +++ /dev/null diff --git a/docs/tutorial/highcolors.py.xdotool b/docs/tutorial/highcolors.py.xdotool new file mode 100644 index 0000000..8cde87e --- /dev/null +++ b/docs/tutorial/highcolors.py.xdotool @@ -0,0 +1 @@ +windowsize --usehints $RXVTWINDOWID 26 9 diff --git a/docs/tutorial/highcolors1.png b/docs/tutorial/highcolors1.png Binary files differnew file mode 100644 index 0000000..49b75ca --- /dev/null +++ b/docs/tutorial/highcolors1.png diff --git a/docs/tutorial/index.rst b/docs/tutorial/index.rst index 455223c..c598fa0 100644 --- a/docs/tutorial/index.rst +++ b/docs/tutorial/index.rst @@ -38,7 +38,7 @@ screen and will run until interrupted with *CTRL+C* (*^C*). from the user. In this case our widgets can't handle the input so we need to interrupt the program to exit with *^C*. -.. image:: minimal.png +.. image:: minimal1.png Handling input -------------- @@ -137,7 +137,7 @@ and will work in any terminal that supports 256-color mode. It will exit when :meth:`set_terminal_properties` method. This method works only when using the default :class:`raw_display.Screen` class in our :class:`MainLoop`. -.. image:: highcolors.png +.. image:: highcolors1.png Conversation example ==================== diff --git a/docs/tutorial/input.py.xdotool b/docs/tutorial/input.py.xdotool new file mode 100644 index 0000000..6ce6386 --- /dev/null +++ b/docs/tutorial/input.py.xdotool @@ -0,0 +1,5 @@ +windowsize --usehints $RXVTWINDOWID 12 3 +key --window $RXVTWINDOWID Return +key --window $RXVTWINDOWID N +key --window $RXVTWINDOWID O +key --window $RXVTWINDOWID P diff --git a/docs/tutorial/input1.png b/docs/tutorial/input1.png Binary files differindex a96fcb2..c1365df 100644 --- a/docs/tutorial/input1.png +++ b/docs/tutorial/input1.png diff --git a/docs/tutorial/input2.png b/docs/tutorial/input2.png Binary files differindex 598ed9c..4a4528b 100644 --- a/docs/tutorial/input2.png +++ b/docs/tutorial/input2.png diff --git a/docs/tutorial/input3.png b/docs/tutorial/input3.png Binary files differindex 8025f19..2127fbc 100644 --- a/docs/tutorial/input3.png +++ b/docs/tutorial/input3.png diff --git a/docs/tutorial/input4.png b/docs/tutorial/input4.png Binary files differindex ff16124..6dc5ab3 100644 --- a/docs/tutorial/input4.png +++ b/docs/tutorial/input4.png diff --git a/docs/tutorial/input5.png b/docs/tutorial/input5.png Binary files differindex 4be5161..852dfe3 100644 --- a/docs/tutorial/input5.png +++ b/docs/tutorial/input5.png diff --git a/docs/tutorial/lbcont.py.xdotool b/docs/tutorial/lbcont.py.xdotool new file mode 100644 index 0000000..f87a990 --- /dev/null +++ b/docs/tutorial/lbcont.py.xdotool @@ -0,0 +1,3 @@ +windowsize --usehints $RXVTWINDOWID 23 13 key --window $RXVTWINDOWID A b e Return B o b +key --window $RXVTWINDOWID Return C a r l Return +key --window $RXVTWINDOWID D a v e Return diff --git a/docs/tutorial/lbcont1.png b/docs/tutorial/lbcont1.png Binary files differindex 441884f..10d6167 100644 --- a/docs/tutorial/lbcont1.png +++ b/docs/tutorial/lbcont1.png diff --git a/docs/tutorial/lbcont2.png b/docs/tutorial/lbcont2.png Binary files differindex e8e24a2..f22a874 100644 --- a/docs/tutorial/lbcont2.png +++ b/docs/tutorial/lbcont2.png diff --git a/docs/tutorial/lbcont3.png b/docs/tutorial/lbcont3.png Binary files differindex f9ae672..2e58c91 100644 --- a/docs/tutorial/lbcont3.png +++ b/docs/tutorial/lbcont3.png diff --git a/docs/tutorial/lbscr.py.xdotool b/docs/tutorial/lbscr.py.xdotool new file mode 100644 index 0000000..2b2e359 --- /dev/null +++ b/docs/tutorial/lbscr.py.xdotool @@ -0,0 +1,9 @@ +windowsize --usehints $RXVTWINDOWID 15 7 +key --window $RXVTWINDOWID Down +key --window $RXVTWINDOWID Down +key --window $RXVTWINDOWID Down +key --window $RXVTWINDOWID Up +key --window $RXVTWINDOWID Up +windowsize --usehints $RXVTWINDOWID 20 9 +windowsize --usehints $RXVTWINDOWID 25 7 +windowsize --usehints $RXVTWINDOWID 11 13 diff --git a/docs/tutorial/lbscr1.png b/docs/tutorial/lbscr1.png Binary files differindex ebf06b8..7a3e188 100644 --- a/docs/tutorial/lbscr1.png +++ b/docs/tutorial/lbscr1.png diff --git a/docs/tutorial/lbscr2.png b/docs/tutorial/lbscr2.png Binary files differindex 05005d6..7a7bcbd 100644 --- a/docs/tutorial/lbscr2.png +++ b/docs/tutorial/lbscr2.png diff --git a/docs/tutorial/lbscr3.png b/docs/tutorial/lbscr3.png Binary files differindex c536a1f..dca6f5f 100644 --- a/docs/tutorial/lbscr3.png +++ b/docs/tutorial/lbscr3.png diff --git a/docs/tutorial/lbscr4.png b/docs/tutorial/lbscr4.png Binary files differindex 1c24f91..ed82a33 100644 --- a/docs/tutorial/lbscr4.png +++ b/docs/tutorial/lbscr4.png diff --git a/docs/tutorial/lbscr5.png b/docs/tutorial/lbscr5.png Binary files differindex 817baae..9fd59e1 100644 --- a/docs/tutorial/lbscr5.png +++ b/docs/tutorial/lbscr5.png diff --git a/docs/tutorial/lbscr6.png b/docs/tutorial/lbscr6.png Binary files differindex 41c796a..0134bbd 100644 --- a/docs/tutorial/lbscr6.png +++ b/docs/tutorial/lbscr6.png diff --git a/docs/tutorial/lbscr7.png b/docs/tutorial/lbscr7.png Binary files differindex daae2cb..075eafd 100644 --- a/docs/tutorial/lbscr7.png +++ b/docs/tutorial/lbscr7.png diff --git a/docs/tutorial/lbscr8.png b/docs/tutorial/lbscr8.png Binary files differindex 4b60e75..a29be51 100644 --- a/docs/tutorial/lbscr8.png +++ b/docs/tutorial/lbscr8.png diff --git a/docs/tutorial/lbscr9.png b/docs/tutorial/lbscr9.png Binary files differindex 6826efa..b883980 100644 --- a/docs/tutorial/lbscr9.png +++ b/docs/tutorial/lbscr9.png diff --git a/docs/tutorial/minimal.png b/docs/tutorial/minimal.png Binary files differdeleted file mode 100644 index 1580ca1..0000000 --- a/docs/tutorial/minimal.png +++ /dev/null diff --git a/docs/tutorial/minimal.py.xdotool b/docs/tutorial/minimal.py.xdotool new file mode 100644 index 0000000..b941d8f --- /dev/null +++ b/docs/tutorial/minimal.py.xdotool @@ -0,0 +1 @@ +windowsize --usehints $RXVTWINDOWID 21 7 diff --git a/docs/tutorial/minimal1.png b/docs/tutorial/minimal1.png Binary files differnew file mode 100644 index 0000000..8593e01 --- /dev/null +++ b/docs/tutorial/minimal1.png |
