From 65682815891e730f57fc4f3b3e628c556beddf50 Mon Sep 17 00:00:00 2001 From: Eric Blade Date: Mon, 31 Aug 2009 03:19:23 -0500 Subject: [PATCH] Hand: will give you a proper message to the console if it can't figure out what your datetime passed to it is --- pyfpdb/Hand.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index cf5f3317..eca0253f 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -584,8 +584,15 @@ Map the tuple self.gametype onto the pokerstars string describing it else: # non-mixed cash games gs = gs + " %s (%s) - " % (self.getGameTypeAsString(), self.getStakesAsString()) - return gs + datetime.datetime.strftime(self.starttime,'%Y/%m/%d %H:%M:%S ET') - + try: + timestr = datetime.datetime.strftime(self.starttime, '%Y/%m/%d %H:%M:%S ET') + except TypeError: + print "*** ERROR - HAND: calling writeGameLine with unexpected STARTTIME value, expecting datetime.date object, received:", self.starttime + print "*** Make sure your HandHistoryConverter is setting hand.starttime properly!" + print "*** Game String:", gs + return gs + else: + return gs + timestr def writeTableLine(self): table_string = "Table \'%s\' %s-max" % (self.tablename, self.maxseats)