diff options
author | John Wiegley <johnw@newartisans.com> | 2004-08-03 04:34:50 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:40:47 -0400 |
commit | a32173ace60df5a1e9414f5e95b556c436f62718 (patch) | |
tree | fff5b881c657fddb8543b0f787bfa75cf009a0b7 /scripts/confirm.py | |
parent | cc98b59d1e99238270eb307b117da8b0b35e6f27 (diff) | |
download | fork-ledger-a32173ace60df5a1e9414f5e95b556c436f62718.tar.gz fork-ledger-a32173ace60df5a1e9414f5e95b556c436f62718.tar.bz2 fork-ledger-a32173ace60df5a1e9414f5e95b556c436f62718.zip |
changes
Diffstat (limited to 'scripts/confirm.py')
-rwxr-xr-x | scripts/confirm.py | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/scripts/confirm.py b/scripts/confirm.py deleted file mode 100755 index 1132ca0c..00000000 --- a/scripts/confirm.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/python - -# This script confirms what ledger tells you. - -import sys -import os -import re - -def clean(num): - return float(re.sub("(\s+|\$|,)","",num)) - -running_total = 0.0 -index = 1 -last_line = "" - -for line in os.popen("../ledger %s reg %s" % (sys.argv[1], sys.argv[2])): - value = clean(line[55:67]) - total = clean(line[68:]) - - running_total += value - if abs(running_total - total) > 0.001: - print "! discrepancy of %.2f (%.2f - %.2f) at line %d:" % \ - (running_total - total, running_total, total, index) - print line, - running_total = total - - index += 1 - last_line = line - -balance_total = 0.0 - -for line in os.popen("../ledger %s bal %s" % (sys.argv[1], sys.argv[2])): - balance_total = clean(line[:20]) - -if abs(balance_total - running_total) > 0.001: - print - print "! discrepancy of %.2f (%.2f - %.2f) between register and balance" % \ - (balance_total - running_total, balance_total, running_total) - print last_line, - print line, |