7 wget --no-check-certificate http://github.com/malsup/form/raw/master/jquery.form.js
10 rst2html --link-stylesheet --stylesheet-path=survey.css survey.rst > $@
12 results.html: results.rst figures/stats.txt
13 rst2html --link-stylesheet --stylesheet-path=survey.css results.rst > $@
15 results_snippet.html: results.html
16 head -n$$(echo "$$(grep -n '</body>' < results.html | cut -d ':' -f 1,1) - 1" \
18 | tail -n$$(echo "$$(wc -l < results.html) - $$(grep -n '<body>' \
19 < results.html | cut -d ':' -f 1,1) - 2" | bc ) > $@
21 figures/stats.txt: statfigures
23 statfigures: oslist.txt swlist.txt datamodlist.txt employer-dd-list.txt position-dd-list.txt ratingslist.txt vmlist.txt
26 @[ "$$(cat nsubmissions.stamp 2>/dev/null || echo)" != "$$(ls -1 data |wc -l)" ] \
27 && echo "I: Re-generating stats figures" \
28 && ls -1 data |wc -l > nsubmissions.stamp \
29 && MVPA_MATPLOTLIB_BACKEND=agg ./makestats data figures || true
34 rsync -rvzlhp --delete \
35 neurodebian@www.pymvpa.org:/home/neurodebian/survey/data .
38 oslist.txt: select_os_options.inc
39 grep -v selected select_os_options.inc | sed -e 's/<option value="//' \
40 -e 's/" label="/: "/' -e 's/">.*$$/"/' > $@
42 swlist.txt: survey.rst
43 grep '"sw.*" value' survey.rst | sed -e 's/.*name="sw.*" value="//' -e 's," />,: ",' \
44 -e 's,</td>$$,",' -e 's/ "$$/ "Other"/' > $@
46 vmlist.txt: survey.rst
47 grep virt_prod survey.rst | sed -e 's/.*<input.*value="//' \
48 -e 's," />,: ",' -e 's,<br />.*$$,,' -e 's/ "$$/ "Other VM"/' > $@
50 datamodlist.txt: survey.rst
51 grep '"bg_datamod"' survey.rst | sed -e 's/.*name="bg_datamod" value="//' \
52 -e 's," />,: ",' -e 's,<br />$$,",' -e 's/ "$$/ "Other"/' > $@
54 # Generic rule to extract from drop-down selections
55 %-dd-list.txt: survey.rst
56 @echo "I: Extracting fields for $* into $@"
57 @sed -n -e '/bg_$*/,/\/tr/p' survey.rst \
58 | sed -ne '/option/s,.*value="\([^"]*\)" *label=\("[^"]*"\)>.*,\1: \2,gp' >| $@
60 ratingslist.txt: survey.rst
61 @echo "I: Extracting fields for ratings into $@"
62 @grep -B 6 -e 'radio.*_r.*value="3"' survey.rst \
63 | grep -v -e '^\.\. raw' -e '^[ -]*$$' -e '<td' \
64 | sed -e 's,.*name="\([^"]*\)" value.*,|\1#,g' \
66 | sed -e 's,#,#\n,g' \
67 | sed -e 's,\(.*\)|\(.*\)#,\2: "\1",g' >| $@
69 upload: index.html results.html results_snippet.html jquery.form.js survey.css surveycollector.cgi
70 rsync -rvzlhp --delete \
71 --exclude='*.txt' --exclude=data --exclude='*.cgi' --exclude=figures \
72 --chmod=Dg+s,g+rw * neurodebian@www.pymvpa.org:/home/neurodebian/survey/
73 scp surveycollector.cgi neurodebian@www.pymvpa.org:/srv/neuro.debian.net/cgi-bin/