commit 962caba674ca4ce32c7009b042adf409e8154d9d
parent 051c8c25f0866be73ea5a2547aeed74621374df5
Author: Nick Hopper <hopper@cs.umn.edu>
Date: Wed, 22 Jan 2014 21:39:14 -0600
Changes to allow comma-split www_sections
Diffstat:
4 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/BibTeX.py b/BibTeX.py
@@ -10,6 +10,7 @@ import cStringIO
import re
import sys
import os
+import copy
import config
@@ -160,10 +161,15 @@ def splitEntriesBy(entries, field):
result = {}
for ent in entries:
key = ent.get(field)
- try:
- result[key].append(ent)
- except:
- result[key] = [ent]
+ if field in config.MULTI_VAL_FIELDS:
+ key = [k.strip() for k in key.split(',')]
+ else:
+ key = [key]
+ for k in key:
+ try:
+ result[k].append(ent)
+ except:
+ result[k] = [ent]
return result
def splitSortedEntriesBy(entries, field):
@@ -195,7 +201,12 @@ def sortEntriesBy(entries, field, default):
v = ent.get(field, default)
if v.startswith("<span class='bad'>"):
v = default
- tmp.append((txtize(v), i, ent))
+ if field in config.MULTI_VAL_FIELDS:
+ for v_j in v.split(','):
+ ent_j = copy.deepcopy(ent)
+ ent_j.__setitem__(field, v_j.strip())
+ tmp.append((txtize(v_j.strip()), i, ent_j))
+ else: tmp.append((txtize(v), i, ent))
tmp.sort()
return [ t[2] for t in tmp ]
diff --git a/anonbib.bib b/anonbib.bib
@@ -4022,7 +4022,7 @@ www_pdf_url = "http://pasiphae.cs.rpi.edu/~edmanm/isi07.pdf",
publisher = {Springer-Verlag},
www_pdf_url = {https://www.cosic.esat.kuleuven.be/publications/article-890.pdf},
www_tags = {selected},
- www_section = {misc},
+ www_section = misc,
}
@InProceedings{diaz-esorics2008,
@@ -4037,7 +4037,7 @@ www_pdf_url = "http://pasiphae.cs.rpi.edu/~edmanm/isi07.pdf",
series = {Lecture Notes in Computer Science},
location = {Malaga,ES},
publisher = {Springer-Verlag},
- www_section = {misc},
+ www_section = misc,
www_pdf_url = {https://www.cosic.esat.kuleuven.be/publications/article-1051.pdf},
}
%% pages = {18},
@@ -4058,7 +4058,7 @@ www_pdf_url = "http://pasiphae.cs.rpi.edu/~edmanm/isi07.pdf",
www_tags = {selected},
www_pdf_url = {https://www.cosic.esat.kuleuven.be/publications/article-925.pdf},
- www_section = {traffic},
+ www_section = traffic,
}
@inproceedings{torspinISC08,
@@ -4178,7 +4178,7 @@ www_pdf_url = "http://pasiphae.cs.rpi.edu/~edmanm/isi07.pdf",
location = {Leuven, Belgium},
bookurl = {http://petsymposium.org/2008/},
pages = {115--132},
- www_section = {traffic},
+ www_section = traffic,
www_tags = {selected},
www_pdf_url = {http://www.cl.cam.ac.uk/~sjm217/papers/pets08metrics.pdf},
}
@@ -4194,7 +4194,7 @@ www_pdf_url = "http://pasiphae.cs.rpi.edu/~edmanm/isi07.pdf",
location = {Leuven, Belgium},
bookurl = {http://petsymposium.org/2008/},
pages = {133--150},
- www_section = {traffic},
+ www_section = traffic,
www_tags = {selected},
www_pdf_url = {http://research.microsoft.com/~gdane/papers/bridge.pdf},
www_important = 1,
@@ -5678,7 +5678,7 @@ www_pdf_url = {http://www.cs.gmu.edu/~xwangc/Publications/DSN2009-Anonymity-Came
pages={247--262},
year={2011},
organization={IEEE},
- www_section={misc},
+ www_section=misc,
www_pdf_url={http://infoscience.epfl.ch/record/164572/files/ShokriTLH_SP11.pdf}
}
@@ -5689,7 +5689,7 @@ www_pdf_url = {http://www.cs.gmu.edu/~xwangc/Publications/DSN2009-Anonymity-Came
pages={57--76},
year={2011},
publisher={Springer},
- www_section={misc},
+ www_section=misc,
www_pdf_url={http://infoscience.epfl.ch/record/164777/files/ShokriTDHL_PETS11.pdf}
}
diff --git a/anonbib.cfg b/anonbib.cfg
@@ -228,7 +228,7 @@ TAG_SHORT_TITLES = { "": "Anonymity Bibliography",
# Directories where tag pages get generated.
TAG_DIRECTORIES = { '': "full",
"selected": "" }
-
+MULTI_VAL_FIELDS = [ "www_section" ]
# Make cached stuff group-writable. Make sure that your cache directories
# are sticky!
CACHE_UMASK = 002
diff --git a/config.py b/config.py
@@ -10,7 +10,7 @@ _KEYS = [ "ALL_TAGS",
"DOWNLOAD_CONNECT_TIMEOUT","INITIAL_STRINGS",
"MASTER_BIB", "NO_COLLAPSE_AUTHORS", "OMIT_ENTRIES",
"OUTPUT_DIR", "TEMPLATE_FILE", "BIBTEX_TEMPLATE_FILE",
- "REQUIRE_KEY", "TAG_TITLES", "TAG_DIRECTORIES", "TAG_SHORT_TITLES",
+ "REQUIRE_KEY", "TAG_TITLES", "TAG_DIRECTORIES", "TAG_SHORT_TITLES", "MULTI_VAL_FIELDS"
]
for _k in _KEYS:
@@ -54,3 +54,4 @@ AUTHOR_RE_LIST = []
NO_COLLAPSE_AUTHORS_RE_LIST = []
ALPHABETIZE_AUTHOR_AS_RE_LIST = []
+