return len(self.iderrs) def usage(): print "usage property.py dir dumpdur" if __name__ == "__main__": import sys if len(sys.argv) != 3: usage() sys.exit(1) pr = Properties(sys.argv[1], sys.argv[2]) ## accounts must be loaded ac = Accounts(sys.argv[1], sys.argv[2]) if ac.run(): ac.showErrors(open("errs/acc_errlog.txt", "w")) print "Correct errors in Accounts first" # sys.exit(1) pr.setAccount(ac.mloaded) if pr.run(): print "errors in property" pr.showErrors(open("errs/prop_errlog.txt", "w")) # sys.exit(1) if pr.loadChangedIDs(): pr.showChangeIDErrors(open("errs/pr_changeIDErrs.txt", "w")) print "Correct errors in changed ids first" sys.exit(1)
(r,c) = commands.getstatusoutput("rm -f %s"%accErr) (r,c) = commands.getstatusoutput("rm -f %s"%propErr) (r,c) = commands.getstatusoutput("rm -f %s"%copeErr) (r,c) = commands.getstatusoutput("rm -f %s"%polErr) (r,c) = commands.getstatusoutput("rm -f %s"%claimErr) pr = Properties(datadir, dumpdir) ## accounts must be loaded ac = Accounts(datadir, dumpdir) if ac.run(): ac.showErrors(open(accErr, "w")) print "Correct errors in Accounts first" # sys.exit(1) pr.setAccount(ac.mloaded) if pr.run(): print "errors in property" pr.showErrors(open(propErr, "w")) hasErrs = False cope = COPE(datadir, dumpdir) cope.setProperties(pr.mloaded)