aboutsummaryrefslogtreecommitdiffstats
path: root/reconcile.py
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-06-26 03:26:31 +0000
committerNick Mathewson <nickm@torproject.org>2007-06-26 03:26:31 +0000
commit4bb131fdace995de47b2d2f0de95cd2d8d5895f4 (patch)
tree6dd262236386fc6d086fa3c976a1794e745cee51 /reconcile.py
parent407a3f18868aee083296281b8799ea3ff607275f (diff)
downloadanonbib-4bb131fdace995de47b2d2f0de95cd2d8d5895f4.tar.gz
r13506@Kushana: nickm | 2007-06-25 18:10:39 -0400
Clean up last commit; make reconcile.py work again. svn:r216
Diffstat (limited to 'reconcile.py')
-rw-r--r--reconcile.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/reconcile.py b/reconcile.py
index 895cf9f..d871def 100644
--- 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)