commit 977136688c230d7e1c9b5a9d23ba020a77d2e097
parent 474d3ea296321aa39f83af587e9cdadf57498d76
Author: Nick Mathewson <nickm@torproject.org>
Date: Tue, 26 Jun 2007 03:26:31 +0000
r13506@Kushana: nickm | 2007-06-25 18:10:39 -0400
Clean up last commit; make reconcile.py work again.
svn:r216
Diffstat:
4 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/BibTeX.py b/BibTeX.py
@@ -27,7 +27,7 @@ MONTHS = [ None,
WWW_FIELDS = [ 'www_section', 'www_important', 'www_remarks',
'www_abstract_url', 'www_html_url', 'www_pdf_url', 'www_ps_url',
'www_txt_url', 'www_ps_gz_url', 'www_amazon_url',
- 'www_excerpt_url', 'www_cache_section', 'www_tags'] ]
+ 'www_excerpt_url', 'www_cache_section', 'www_tags' ]
def url_untranslate(s):
"""Change a BibTeX key into a string suitable for use in a URL."""
diff --git a/TODO b/TODO
@@ -1,4 +1,5 @@
+
- More general tasks
. Know about @book
. Write unit tests for everything
@@ -26,3 +27,7 @@
if the authors ask us not to cache them.
- Maybe, add ability to cache images from an HTML page.
+- Reconcile tasks
+ - Document it.
+ - Notice when there is new or different information of certain kinds
+ (pages, dates, etc) in the new information.
diff --git a/anonbib.bib b/anonbib.bib
@@ -44,7 +44,6 @@
publisher = {Springer},
address = {Cambridge, UK}
bookurl = {http://petworkshop.org/2006/},
- www_tags={selected},
}
@Proceedings{weis2006,
@@ -54,7 +53,6 @@
year = {2006},
address = {Cambridge, UK}
bookurl = {http://weis2006.econinfosec.org/},
- www_tags={selected},
}
@Proceedings{eurocrypt2005,
diff --git a/reconcile.py b/reconcile.py
@@ -3,7 +3,7 @@
"""Code to determine which entries are new and which are old.
- To merge in a new file, run "python reconcile.py new-file.bib". This
+ To scan a new file, run "python reconcile.py anonbib.cfg new-file.bib". This
will generate a new bibtex file called 'tmp.bib', with all the new entries
cleaned up a little, and all the duplicate entries commented out.
"""
@@ -242,18 +242,20 @@ def emitKnown(f, ent, matches):
print >>f, "%"+(ent.format(77,4,1,invStrings).replace("\n", "\n%"))
if __name__ == '__main__':
- if len(sys.argv) != 2:
- print "reconcile.py expects 1 argument"
+ if len(sys.argv) != 3:
+ print "reconcile.py expects 2 arguments"
sys.exit(1)
+ config.load(sys.argv[1])
+
print "========= Scanning master =========="
master = MasterBibTeX()
- master = BibTeX.parseFile(config.MASTER_BIB, master)
+ master = BibTeX.parseFile(config.MASTER_BIB, result=master)
master.buildIndex()
print "========= Scanning new file ========"
try:
- fn = sys.argv[1]
+ fn = sys.argv[2]
input = BibTeX.parseFile(fn)
except BibTeX.ParseError, e:
print "Error parsing %s: %s"%(fn,e)