From 54d92a9a238dc5e13a527b18e2251396f3048be1 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 16 May 2011 12:36:05 -0400 Subject: [PATCH] provide human-readable descriptions for positions and employer (venue) --- survey/Makefile | 8 +++++++- survey/makestats | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/survey/Makefile b/survey/Makefile index 31ee5e1..ef2d8f1 100644 --- a/survey/Makefile +++ b/survey/Makefile @@ -18,7 +18,7 @@ results_snippet.html: results.html | tail -n$$(echo "$$(wc -l < results.html) - $$(grep -n '' \ < 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,
$$,",' -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=surveydata --exclude='*.cgi' --exclude=figures \ diff --git a/survey/makestats b/survey/makestats index 540e209..3829f13 100755 --- a/survey/makestats +++ b/survey/makestats @@ -93,6 +93,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 @@ -160,7 +162,8 @@ class DB(dict): def get_nice_name(self, id): srcs = [DB.os_dict, os_cat_names, DB.sw_dict, sw_categories, - resource_categories, DB.datamod_dict] + resource_categories, DB.datamod_dict, DB.position_dict, + DB.employer_dict] for src in srcs: if id in src: return src[id] -- 2.39.2