Merge branch 'master' of git://git.assembla.com/free_poker_tools.git

Conflicts:
	pyfpdb/fpdb_simple.py
This commit is contained in:
eblade 2008-12-14 21:57:03 -05:00
commit 65e43a34e6
5 changed files with 26 additions and 10 deletions

View File

@ -25,6 +25,7 @@ Handles HUD configuration files.
# Standard Library modules
import os
import sys
import inspect
import string
import traceback
import shutil
@ -582,6 +583,10 @@ class Config:
sg.append(c.supported_games[game].game_name)
return sg
def execution_path(self, filename):
"""Join the fpdb path to filename."""
return os.path.join(os.path.dirname(inspect.getfile(sys._getframe(1))), filename)
if __name__== "__main__":
c = Config()
@ -638,3 +643,5 @@ if __name__== "__main__":
for game in c.get_supported_games():
print c.get_game_parameters(game)
print "start up path = ", c.execution_path("")

View File

@ -23,6 +23,7 @@ pygtk.require('2.0')
import gtk
import gobject
import os
import sys
import time
import fpdb_import
@ -126,8 +127,7 @@ class GuiAutoImport (threading.Thread):
self.pipe_to_hud = subprocess.Popen(command, bufsize = bs, stdin = subprocess.PIPE,
universal_newlines=True)
else:
cwd = os.getcwd()
command = os.path.join(cwd, 'HUD_main.py')
command = self.config.execution_path('HUD_main.py')
bs = 1
self.pipe_to_hud = subprocess.Popen((command, self.database), bufsize = bs, stdin = subprocess.PIPE,
universal_newlines=True)

View File

@ -266,7 +266,7 @@ class Stud_cards:
card_images = {}
suits = ('S', 'H', 'D', 'C')
ranks = ('A', 'K', 'Q', 'J', 'T', '9', '8', '7', '6', '5', '4', '3', '2', 'B')
pb = gtk.gdk.pixbuf_new_from_file("54PFozzycards0.png")
pb = gtk.gdk.pixbuf_new_from_file(self.config.execution_path("54PFozzycards0.png"))
for j in range(0, 14):
for i in range(0, 4):

View File

@ -342,6 +342,7 @@ def clean_title(name):
for pattern in [' \(6 max\)', ' \(heads up\)', ' \(deep\)',
' \(deep hu\)', ' \(deep 6\)', ' \(2\)',
' \(edu\)', ' \(edu, 6 max\)', ' \(6\)',
' \(speed\)',
' no all-in', ' fast', ',', ' 50BB min', '\s+$']:
name = re.sub(pattern, '', name)
name = name.rstrip()
@ -368,12 +369,12 @@ def discover_mac_by_name(c, tablename):
if __name__=="__main__":
c = Configuration.Config()
print discover_table_by_name(c, "Louie")
print discover_table_by_name(c, "Ringe")
# print discover_tournament_table(c, "118942908", "3")
tables = discover(c)
for t in tables.keys():
print tables[t]
# tables = discover(c)
# for t in tables.keys():
# print tables[t]
print "press enter to continue"
sys.stdin.readline()

View File

@ -771,7 +771,7 @@ def parseCardLine(site, category, street, line, names, cardValues, cardSuits, bo
print "line:",line,"cardValues[playerNo]:",cardValues[playerNo]
raise FpdbError("read too many/too few holecards in parseCardLine")
elif (category=="razz" or category=="studhi" or category=="studhilo"):
if (line.find("shows")==-1):
if (line.find("shows")==-1 and line.find("mucked")==-1):
#print "parseCardLine(in stud if), street:", street
if line[pos+2]=="]": #-> not (hero and 3rd street)
cardValues[playerNo][street+2]=line[pos:pos+1]
@ -1005,7 +1005,15 @@ def parseTableLine(site, base, line):
elif line.find("heads up")!=-1:
maxSeats=2
return {'maxSeats':maxSeats, 'tableName':line[pos1:pos2]}
tableName = line[pos1:pos2]
for pattern in [' \(6 max\)', ' \(heads up\)', ' \(deep\)',
' \(deep hu\)', ' \(deep 6\)', ' \(2\)',
' \(edu\)', ' \(edu, 6 max\)', ' \(6\)',
' \(speed\)',
' no all-in', ' fast', ',', ' 50BB min', '\s+$']:
tableName = re.sub(pattern, '', tableName)
tableName = tableName.rstrip()
return {'maxSeats':maxSeats, 'tableName':tableName}
else:
raise FpdbError("invalid site ID")
#end def parseTableLine