From 25be578e7dcf5f1b46546d9c71b9bfe0cef78248 Mon Sep 17 00:00:00 2001 From: grindi Date: Thu, 6 Aug 2009 21:26:55 +0400 Subject: [PATCH] Fixed imported hands accounting --- pyfpdb/HandHistoryConverter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyfpdb/HandHistoryConverter.py b/pyfpdb/HandHistoryConverter.py index 6d653509..fb7311ab 100644 --- a/pyfpdb/HandHistoryConverter.py +++ b/pyfpdb/HandHistoryConverter.py @@ -1,4 +1,5 @@ #!/usr/bin/python +# -*- coding: utf-8 -*- #Copyright 2008 Carl Gherardi #This program is free software: you can redistribute it and/or modify @@ -95,12 +96,14 @@ Otherwise, finish at eof. else: handsList = self.allHandsAsList() logging.info("Parsing %d hands" % len(handsList)) + nBadHangs = 0 for handText in handsList: try: self.processedHands.append(self.processHand(handText)) - except Exception, e: # TODO: it's better to write something like HhcEception here + except Exception, e: # TODO: it's better to replace it with s-t like HhcEception + nBadHangs += 1 logging.error("Caught exception while parsing hand: %s" % str(e)) - numHands= len(handsList) + numHands = len(handsList) - nBadHangs endtime = time.time() print "read %d hands in %.3f seconds" % (numHands, endtime - starttime) if self.out_fh != sys.stdout: