]> git.donarmstrong.com Git - neurodebian.git/commitdiff
Merge branch 'master' of git://git.debian.org/pkg-exppsy/neurodebian
authorYaroslav Halchenko <debian@onerussian.com>
Mon, 16 May 2011 16:38:05 +0000 (12:38 -0400)
committerYaroslav Halchenko <debian@onerussian.com>
Mon, 16 May 2011 16:38:05 +0000 (12:38 -0400)
* 'master' of git://git.debian.org/pkg-exppsy/neurodebian:
  Fix div by zero prob.
  Make time figure.

Conflicts:
survey/makestats -- in list of sources for get_nice_name

survey/Makefile
survey/makestats

index 9ce5fc06e945781dfd3d880c88327a343e21eedb..e817fc8ed400aacc1765ccd58b90db052107c2b7 100644 (file)
@@ -18,7 +18,7 @@ results_snippet.html: results.html
                | tail -n$$(echo "$$(wc -l < results.html) - $$(grep -n '<body>' \
                < results.html | cut -d ':' -f 1,1) - 2" | bc ) > $@
 
-statfigures: oslist.txt swlist.txt datamodlist.txt
+statfigures: oslist.txt swlist.txt datamodlist.txt employer-dd-list.txt position-dd-list.txt
 # create "lockfile'
        @touch $@
        @[ "$$(cat nsubmissions.stamp 2>/dev/null || echo)" != "$$(ls -1 data |wc -l)" ] \
@@ -43,6 +43,12 @@ datamodlist.txt: survey.rst
        grep '"bg_datamod"' survey.rst | sed -e 's/.*name="bg_datamod" value="//' \
                -e 's," />,: ",' -e 's,<br />$$,",' -e 's/ "$$/ "Other"/' > $@
 
+# Generic rule to extract from drop-down selections
+%-dd-list.txt: survey.rst
+       @echo "I: Extracting fields for $* into $@"
+       @sed -n -e '/bg_$*/,/\/tr/p' survey.rst \
+       | sed -ne '/option/s,.*value="\([^"]*\)" *label=\("[^"]*"\)>.*,\1: \2,gp' >| $@
+
 upload: index.html results.html results_snippet.html jquery.form.js survey.css surveycollector.cgi
        rsync -rvzlhp --delete  \
         --exclude='*.txt' --exclude=data --exclude='*.cgi' --exclude=figures \
index 09b0c9415b20fe6d7f39a554c2c836dc841cfa7d..7da486e97ba46760ec4e3beb84f5e43ad3f53964 100755 (executable)
@@ -101,6 +101,8 @@ class DB(dict):
     os_dict = load_list2dict('oslist.txt')
     datamod_dict = load_list2dict('datamodlist.txt')
     sw_dict = load_list2dict('swlist.txt')
+    position_dict = load_list2dict('position-dd-list.txt')
+    employer_dict = load_list2dict('employer-dd-list.txt')
 
     def __init__(self, srcdir):
         # eats the whole directory
@@ -168,7 +170,8 @@ class DB(dict):
 
     def get_nice_name(self, id):
         srcs = [DB.os_dict, os_cat_names, DB.sw_dict, sw_categories,
-                resource_categories, time_categories, DB.datamod_dict]
+                resource_categories, time_categories,
+                DB.datamod_dict, DB.position_dict, DB.employer_dict]
         for src in srcs:
             if id in src:
                 return src[id]