diff options
| author | Nick Mathewson <nickm@torproject.org> | 2004-08-15 20:03:38 +0000 |
|---|---|---|
| committer | Nick Mathewson <nickm@torproject.org> | 2004-08-15 20:03:38 +0000 |
| commit | 133164406a50d56633fa39fb553cbb838f70c529 (patch) | |
| tree | 8f539ac5459da2d832f849743001d83ecccffcc6 /config.py | |
| parent | c1e3f892258e70c5308d9656661a46abcbf691ca (diff) | |
| download | anonbib-133164406a50d56633fa39fb553cbb838f70c529.tar.gz | |
Add basic unit tests; fix lastname,firstname name syntax; make configuration a separate file; make templates a configuration option; add separate cache jails to take advantage of apache http auth (last idea is from geoff)
svn:r109
Diffstat (limited to 'config.py')
| -rw-r--r-- | config.py | 132 |
1 files changed, 29 insertions, 103 deletions
@@ -2,92 +2,38 @@ import re -# Our input filename. -MASTER_BIB = "./anonbib.bib" +_KEYS = [ "ALPHABETIZE_AUTHOR_AS","AUTHOR_URLS","CACHE_DIR","CACHE_SECTIONS", + "COLLAPSE_AUTHORS", + "DOWNLOAD_CONNECT_TIMEOUT","INITIAL_STRINGS", + "MASTER_BIB", "NO_COLLAPSE_AUTHORS", "OMIT_ENTRIES", + "OUTPUT_DIR", "TEMPLATE_FILE", "BIBTEX_TEMPLATE_FILE" ] -# Where do we put generated HTML? -OUTPUT_DIR = "." +for _k in _KEYS: + globals()[_k]=None -# Where do we put cached papers (relative to OUTPUT_DIR) -CACHE_DIR = "cache" +def load(cfgFile): + mod = {} + execfile(cfgFile, mod) + for _k in _KEYS: + try: + globals()[_k]=mod[_k] + except KeyError: + raise KeyError("Configuration option %s is missing"%_k) -# Timeout when downloading from a server while caching, in seconds. -DOWNLOAD_CONNECT_TIMEOUT = 15 + INITIAL_STRINGS.update(_EXTRA_INITIAL_STRINGS) + AUTHOR_RE_LIST[:] = [ + (re.compile(k, re.I), v,) for k, v in AUTHOR_URLS.items() + ] -# Map from author name regex to author homepage. -AUTHOR_URLS = { - 'Ross.*Anderson' : 'http://www.cl.cam.ac.uk/users/rja14/', - 'Alessandro.*Acquisti' : 'http://www.sims.berkeley.edu/~acquisti/', - 'Adam.*Back' : 'http://www.cypherspace.org/~adam/', - 'Berthold' : 'http://page.inf.fu-berlin.de/~berthold/', - 'Miguel.*Castro' : 'http://research.microsoft.com/users/mcastro/', - 'Chaum' : 'http://www.chaum.com/', - 'J.*Claessens' : 'http://www.esat.kuleuven.ac.be/~joclaess/', - 'R.*Clayton' : 'http://www.cl.cam.ac.uk/~rnc1/', - 'Danezis' : 'http://www.cl.cam.ac.uk/~gd216/', - 'Claudia.*az' : 'http://www.esat.kuleuven.ac.be/~cdiaz/', - 'Dingledine' : 'http://www.freehaven.net/~arma/cv.html', - 'Desmedt' : 'http://www.cs.fsu.edu/~desmedt/', - 'Douceur' : 'http://research.microsoft.com/~johndo/', - 'Michael.*Freedman' : 'http://www.scs.cs.nyu.edu/~mfreed/', - 'Ian.*Goldberg' : 'http://www.cs.berkeley.edu/~iang/', - 'Christian.*Grothoff' : 'http://www.ovmj.org/~grothoff/', - 'D.*Hopwood' : 'http://www.users.zetnet.co.uk/hopwood/', - 'Jakobsson' : 'http://www.rsasecurity.com/rsalabs/staff/bios/mjakobsson/', - 'Juels' : 'http://www.rsasecurity.com/rsalabs/staff/bios/ajuels/', - 'K.*Kurosawa' : 'http://kuro.cis.ibaraki.ac.jp/~kurosawa/', - 'H.*Langos' : 'http://www.wh9.tu-dresden.de/~heinrich/', - 'B.*Liskov' : 'http://www.pmg.lcs.mit.edu/barbara_liskov.html', - 'Mathewson' : 'http://www.wangafu.net/~nickm/', - 'Mazières' : 'http://www.scs.cs.nyu.edu/~dm/', - 'B.*Möller' : ('http://www.informatik.tu-darmstadt.de/TI/' - 'Mitarbeiter/moeller.html'), - 'U.*Möller' : 'http://www.ulfm.de/', - 'D.*Molnar' : 'http://hcs.harvard.edu/~dmolnar/papers.html', - 'R.*Morris' : 'http://www.pdos.lcs.mit.edu/~rtm/', - 'A.*Pfitzmann' : 'http://dud.inf.tu-dresden.de/~pfitza/', - 'B.*Pfitzmann' : 'http://www.zurich.ibm.com/~bpf/', - 'B.*Preneel' : 'http://www.esat.kuleuven.ac.be/~preneel/', - 'Daniel.*Simon' : 'http://research.microsoft.com/crypto/dansimon/me.htm', - 'Rackoff' : 'http://www.cs.toronto.edu/DCS/People/Faculty/rackoff.html', - 'Jean F' : 'http://www.geocities.com/j_f_raymond/', - 'M.*Rennhard' : 'http://www.tik.ee.ethz.ch/~rennhard/', - 'M.*Reiter' : 'http://www.ece.cmu.edu/~reiter/', - 'Rivest' : 'http://theory.lcs.mit.edu/~rivest/', - 'Avi.*Rubin' : 'http://avirubin.com/', - 'Serjantov' : 'http://www.cl.cam.ac.uk/users/aas23/', - 'S.*Seys' : 'http://www.esat.kuleuven.ac.be/~sseys/', - 'Shoup' : 'http://www.shoup.net/', - 'Syverson' : 'http://www.syverson.org/', - 'Tsudik' : 'http://www.ics.uci.edu/~gts/c.html', - 'M.*Waidner' : 'http://www.zurich.ibm.com/~wmi/', - 'David.*Wagner' : 'http://www.cs.berkeley.edu/~daw/', - 'M.*Waldman' : 'http://cs1.cs.nyu.edu/~waldman/', - 'B.*Waters' : 'http://www.cs.princeton.edu/~bwaters/', - 'M.*Wright' : 'http://www.cs.umass.edu/~mwright/', - } + NO_COLLAPSE_AUTHORS_RE_LIST[:] = [ + re.compile(pat, re.I) for pat in NO_COLLAPSE_AUTHORS + ] -# List of paterns for author names _not_ to do an initial-tolerant -# match on when building section list. E.g., if "J\\. Smith" is in -# this list, he won't be folded into "John Smith". -NO_COLLAPSE_AUTHORS = [ + ALPHABETIZE_AUTHOR_AS_RE_LIST[:] = [ + (re.compile(k, re.I), v,) for k,v in ALPHABETIZE_AUTHOR_AS.items() + ] -] - -# Map from LaTeX-style name of author to collapse to canonical name. -COLLAPSE_AUTHORS = { - "Nicholas Mathewson": "Nick Mathewson", - } - -# Map from author pattern to collation key. -# This keeps 'Zero Knowledge Systems' from getting alphabetized as "Systems, -# Zero Knowledge." -ALPHABETIZE_AUTHOR_AS = { - "Zero.*Knowledge.*Systems": "Zero Knowledge Systems", - } - -# Map of strings to initialzie BibTeX parsing with. -INITIAL_STRINGS = { +_EXTRA_INITIAL_STRINGS = { # MONTHS 'jan' : 'January', 'feb' : 'February', 'mar' : 'March', 'apr' : 'April', @@ -95,30 +41,10 @@ INITIAL_STRINGS = { 'jul' : 'July', 'aug' : 'August', 'sep' : 'September', 'oct' : 'October', 'nov' : 'November', 'dec' : 'December', - - # SECTIONS - 'sec_mix' : "Mix Networks: Design", - 'sec_mixattacks' : "Mix Networks: Attacks", - 'sec_stream' : "Stream-based anonymity", - 'sec_traffic' : "Traffic analysis", - 'sec_pub' : "Anonymous publication", - 'sec_nym' : "Pseudonymity" } -# Don't put in any entries of this type. -OMIT_ENTRIES = ("proceedings", "journal") - - -### Don't edit below this line - -AUTHOR_RE_LIST = [ - (re.compile(k, re.I), v,) for k, v in AUTHOR_URLS.items() - ] +AUTHOR_RE_LIST = [] -NO_COLLAPSE_AUTHORS_RE_LIST = [ - re.compile(pat, re.I) for pat in NO_COLLAPSE_AUTHORS - ] +NO_COLLAPSE_AUTHORS_RE_LIST = [] -ALPHABETIZE_AUTHOR_AS_RE_LIST = [ - (re.compile(k, re.I), v,) for k,v in ALPHABETIZE_AUTHOR_AS.items() - ] +ALPHABETIZE_AUTHOR_AS_RE_LIST = [] |
