Merge branch 'master' of git://trac-git.assembla.com/fpdb

This commit is contained in:
Ray 2008-11-07 14:28:58 -05:00
commit 803b9a7a64
5 changed files with 41 additions and 57 deletions

View File

@ -1,11 +0,0 @@
db-backend=2
db-host=localhost
db-databaseName=fpdb
db-user=fpdb
db-password=enterYourPwHere
imp-callFpdbHud=True
tv-combinedStealFold=True
tv-combined2B3B=True
tv-combinedPostflop=True
bulkImport-defaultPath=default
hud-defaultPath=default

View File

@ -78,21 +78,12 @@ class GuiTableViewer (threading.Thread):
if (self.category=="holdem" or self.category=="omahahi" or self.category=="omahahilo"):
tmp=("Name", "HDs", "VPIP", "PFR", "PF3B4B", "ST")
if self.settings['tv-combinedStealFold']:
tmp+=("FSB", )
else:
tmp+=("FS", "FB")
tmp+=("CB", )
if self.settings['tv-combined2B3B']:
tmp+=("23B", )
else:
tmp+=("2B", "3B")
if self.settings['tv-combinedPostflop']:
tmp+=("Postf A", "Postf F")
else:
tmp+=("AF", "FF", "AT", "FT", "AR", "FR")
tmp+=("WtSD", "W$wsF", "W$SD")
@ -144,28 +135,14 @@ class GuiTableViewer (threading.Thread):
tmp.append(self.hudDivide(row[31],row[30])+" ("+str(row[30])+")") #ST
if self.settings['tv-combinedStealFold']:
tmp.append(self.hudDivide(row[35]+row[33],row[34]+row[32])+" ("+str(row[34]+row[32])+")") #FSB
else:
tmp.append(self.hudDivide(row[35],row[34])+" ("+str(row[34])+")") #FS
tmp.append(self.hudDivide(row[33],row[32])+" ("+str(row[32])+")") #FB
tmp.append(self.hudDivide(row[37],row[36])+" ("+str(row[36])+")") #CB
if self.settings['tv-combined2B3B']:
tmp.append(self.hudDivide(row[39]+row[41],row[38]+row[40])+" ("+str(row[38]+row[40])+")") #23B
else:
tmp.append(self.hudDivide(row[39],row[38])+" ("+str(row[38])+")") #2B
tmp.append(self.hudDivide(row[41],row[40])+" ("+str(row[40])+")") #3B
if self.settings['tv-combinedPostflop']:
aggCount=row[16]+row[17]+row[18]
handCount=row[11]+row[12]+row[13]
foldCount=row[24]+row[25]+row[26]
otherRaiseCount=row[20]+row[21]+row[22]
tmp.append(self.hudDivide(aggCount,handCount)+" ("+str(handCount)+")") #Agg
tmp.append(self.hudDivide(foldCount,otherRaiseCount)+" ("+str(otherRaiseCount)+")") #FF
else:
tmp.append(self.hudDivide(row[16],row[11])+" ("+str(row[11])+")") #AF
tmp.append(self.hudDivide(row[24],row[20])+" ("+str(row[20])+")") #FF
tmp.append(self.hudDivide(row[17],row[12])+" ("+str(row[12])+")") #AT

View File

@ -17,10 +17,18 @@
import os
import sys
from optparse import OptionParser
print "Note: error output is being diverted to fpdb-error-log.txt and HUD-error.txt. Any major error will be reported there _only_."
errorFile = open('fpdb-error-log.txt', 'w', 0)
sys.stderr = errorFile
parser = OptionParser()
parser.add_option("-x", "--errorsToConsole", action="store_true",
help="If passed error output will go to the console rather than .")
(options, sys.argv) = parser.parse_args()
if not options.errorsToConsole:
print "Note: error output is being diverted to fpdb-error-log.txt and HUD-error.txt. Any major error will be reported there _only_."
errorFile = open('fpdb-error-log.txt', 'w', 0)
sys.stderr = errorFile
import pygtk
pygtk.require('2.0')

View File

@ -295,4 +295,4 @@ class Importer:
if __name__ == "__main__":
print "CLI for fpdb_import is currently on vacation please check in later"
print "CLI for fpdb_import is now available as CliFpdb.py"

View File

@ -818,16 +818,25 @@ def parseHandStartTime(topline, site):
counter+=1
if counter==10: break
isUTC=False
if site=="ftp":
pos = topline.find(" ", len(topline)-26)+1
tmp = topline[pos:]
#print "year:", tmp[14:18], "month", tmp[19:21], "day", tmp[22:24], "hour", tmp[0:2], "minute", tmp[3:5], "second", tmp[6:8]
result = datetime.datetime(int(tmp[14:18]), int(tmp[19:21]), int(tmp[22:24]), int(tmp[0:2]), int(tmp[3:5]), int(tmp[6:8]))
elif site=="ps":
if topline.find("UTC")!=-1:
pos1 = topline.find("-")+2
pos2 = topline.find("UTC")
tmp=topline[pos1:pos2]
isUTC=True
print "UTC tmp:",tmp
else:
tmp=topline[-30:]
#print "parsehandStartTime, tmp:", tmp
pos = tmp.find("-")+2
tmp = tmp[pos:]
print "ET tmp:",tmp
#Need to match either
# 2008/09/07 06:23:14 ET or
# 2008/08/17 - 01:14:43 (ET)
@ -837,9 +846,10 @@ def parseHandStartTime(topline, site):
else:
raise FpdbError("invalid site in parseHandStartTime")
if site=="ftp" or site=="ps": #these use US ET
if (site=="ftp" or site=="ps") and not isUTC: #these use US ET
result+=datetime.timedelta(hours=5)
print "parseHandStartTime result:",result
return result
#end def parseHandStartTime