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

This commit is contained in:
Worros 2008-11-07 17:16:21 +13:00
commit b32745c28a
4 changed files with 38 additions and 33 deletions

View File

@ -59,6 +59,10 @@ class Database:
user = c.supported_databases[db_name].db_user, user = c.supported_databases[db_name].db_user,
passwd = c.supported_databases[db_name].db_pass, passwd = c.supported_databases[db_name].db_pass,
db = c.supported_databases[db_name].db_name) db = c.supported_databases[db_name].db_name)
cur_iso = self.connection.cursor()
cur_iso.execute('SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED')
cur_iso.close()
except: except:
print "Error opening database connection %s. See error log file." % (file) print "Error opening database connection %s. See error log file." % (file)
traceback.print_exc(file=sys.stderr) traceback.print_exc(file=sys.stderr)

View File

@ -2,7 +2,7 @@
<FreePokerToolsConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FreePokerToolsConfig.xsd"> <FreePokerToolsConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FreePokerToolsConfig.xsd">
<supported_sites> <supported_sites>
<site enabled="True" site_name="PokerStars" table_finder="PokerStars" screen_name="DO NOT NEED THIS YET" site_path="~/.wine/drive_c/Program Files/PokerStars/" HH_path="~/.wine/drive_c/Program Files/PokerStars/HandHistory/abc/" decoder="pokerstars_decode_table" converter="passthrough" supported_games="holdem,razz,omahahi,omahahilo,studhi,studhilo"> <site enabled="True" site_name="PokerStars" table_finder="PokerStars.exe" screen_name="DO NOT NEED THIS YET" site_path="~/.wine/drive_c/Program Files/PokerStars/" HH_path="~/.wine/drive_c/Program Files/PokerStars/HandHistory/abc/" decoder="pokerstars_decode_table" converter="passthrough" supported_games="holdem,razz,omahahi,omahahilo,studhi,studhilo">
<layout max="8" width="792" height="546" fav_seat="0"> <layout max="8" width="792" height="546" fav_seat="0">
<location seat="1" x="684" y="61"> </location> <location seat="1" x="684" y="61"> </location>
<location seat="2" x="689" y="239"> </location> <location seat="2" x="689" y="239"> </location>
@ -84,39 +84,30 @@
<location seat="9" x="70" y="53"> </location> <location seat="9" x="70" y="53"> </location>
</layout> </layout>
</site> </site>
<site enabled="False" site_name="Everleaf" table_finder="Everleaf.exe" screen_name="DO NOT NEED THIS YET" site_path="" HH_path="" decoder="everleaf_decode_table" converter="EverleafToFpdb" supported_games="holdem"> <site enabled="False" site_name="Everleaf" table_finder="Poker.exe" screen_name="DO NOT NEED THIS YET" site_path="" HH_path="" decoder="Unknown" converter="EverleafToFpdb" supported_games="holdem,razz,omahahi,omahahilo,studhi" fgcolor="#48D1CC" bgcolor="#000000">
<layout fav_seat="0" height="547" max="8" width="794"> <layout fav_seat="0" height="546" max="6" width="792">
<location seat="1" x="640" y="64"> </location> <location seat="1" x="581" y="109"> </location>
<location seat="2" x="650" y="230"> </location> <location seat="2" x="605" y="287"> </location>
<location seat="3" x="650" y="385"> </location> <location seat="3" x="544" y="423"> </location>
<location seat="4" x="588" y="425"> </location> <location seat="4" x="80" y="393"> </location>
<location seat="5" x="92" y="425"> </location> <location seat="5" x="5" y="284"> </location>
<location seat="6" x="0" y="373"> </location> <location seat="6" x="38" y="108"> </location>
<location seat="7" x="0" y="223"> </location>
<location seat="8" x="25" y="50"> </location>
</layout> </layout>
<layout fav_seat="0" height="547" max="6" width="794"> <layout fav_seat="0" height="546" max="10" width="792">
<location seat="1" x="640" y="58"> </location> <location seat="1" x="473" y="78"> </location>
<location seat="2" x="654" y="288"> </location> <location seat="2" x="650" y="93"> </location>
<location seat="3" x="615" y="424"> </location> <location seat="3" x="670" y="219"> </location>
<location seat="4" x="70" y="421"> </location> <location seat="4" x="633" y="358"> </location>
<location seat="5" x="0" y="280"> </location> <location seat="5" x="437" y="393"> </location>
<location seat="6" x="70" y="58"> </location> <location seat="6" x="249" y="396"> </location>
<location seat="7" x="42" y="357"> </location>
<location seat="8" x="8" y="218"> </location>
<location seat="9" x="35" y="89"> </location>
<location seat="10" x="217" y="78"> </location>
</layout> </layout>
<layout fav_seat="0" height="547" max="2" width="794"> <layout fav_seat="0" height="546" max="2" width="792">
<location seat="1" x="651" y="288"> </location> <location seat="1" x="651" y="288"> </location>
<location seat="2" x="10" y="288"> </location> <location seat="2" x="10" y="288"> </location>
</layout>
<layout fav_seat="0" height="547" max="9" width="794">
<location seat="1" x="634" y="38"> </location>
<location seat="2" x="667" y="184"> </location>
<location seat="3" x="667" y="321"> </location>
<location seat="4" x="667" y="445"> </location>
<location seat="5" x="337" y="459"> </location>
<location seat="6" x="0" y="400"> </location>
<location seat="7" x="0" y="322"> </location>
<location seat="8" x="0" y="181"> </location>
<location seat="9" x="70" y="53"> </location>
</layout> </layout>
</site> </site>
</supported_sites> </supported_sites>

View File

@ -89,6 +89,7 @@ def update_HUD(new_hand_id, table_name, config, stat_dict):
def read_stdin(): # This is the thread function def read_stdin(): # This is the thread function
global hud_dict global hud_dict
db_connection = Database.Database(config, db_name, 'temp')
while True: # wait for a new hand number on stdin while True: # wait for a new hand number on stdin
new_hand_id = sys.stdin.readline() new_hand_id = sys.stdin.readline()
new_hand_id = string.rstrip(new_hand_id) new_hand_id = string.rstrip(new_hand_id)
@ -101,10 +102,8 @@ def read_stdin(): # This is the thread function
del(hud_dict[h]) del(hud_dict[h])
# connect to the db and get basic info about the new hand # connect to the db and get basic info about the new hand
db_connection = Database.Database(config, db_name, 'temp')
(table_name, max, poker_game) = db_connection.get_table_name(new_hand_id) (table_name, max, poker_game) = db_connection.get_table_name(new_hand_id)
stat_dict = db_connection.get_stats_from_hand(new_hand_id) stat_dict = db_connection.get_stats_from_hand(new_hand_id)
db_connection.close_connection()
# if a hud for this table exists, just update it # if a hud for this table exists, just update it
if hud_dict.has_key(table_name): if hud_dict.has_key(table_name):

View File

@ -399,6 +399,14 @@ class Popup_window:
# need an event box so we can respond to clicks # need an event box so we can respond to clicks
self.window.add(self.ebox) self.window.add(self.ebox)
self.ebox.add(self.lab) self.ebox.add(self.lab)
self.ebox.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(stat_window.parent.colors['hudbgcolor']))
self.ebox.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse(stat_window.parent.colors['hudfgcolor']))
self.window.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(stat_window.parent.colors['hudbgcolor']))
self.window.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse(stat_window.parent.colors['hudfgcolor']))
self.lab.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(stat_window.parent.colors['hudbgcolor']))
self.lab.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse(stat_window.parent.colors['hudfgcolor']))
self.window.realize self.window.realize
# figure out the row, col address of the click that activated the popup # figure out the row, col address of the click that activated the popup
@ -440,6 +448,9 @@ class Popup_window:
self.lab.set_text(pu_text) self.lab.set_text(pu_text)
self.window.show_all() self.window.show_all()
self.window.set_transient_for(stat_window.main_window)
# set_keep_above(1) for windows # set_keep_above(1) for windows
if os.name == 'nt': self.topify_window(self.window) if os.name == 'nt': self.topify_window(self.window)