diff --git a/pyfpdb/HUD_main.pyw b/pyfpdb/HUD_main.pyw old mode 100755 new mode 100644 index 31e50b27..cd29f4ae --- a/pyfpdb/HUD_main.pyw +++ b/pyfpdb/HUD_main.pyw @@ -138,15 +138,12 @@ class HUD_main(object): log.error(e) def client_moved(self, widget, hud): - print "hud_main: client moved" - print hud, hud.table.name, "moved", hud.table.x, hud.table.y + hud.up_update_table_position() def client_resized(self, widget, hud): - print _("hud_main: Client resized") - print hud, hud.table.name, hud.table.x, hud.table.y + pass def client_destroyed(self, widget, hud): # call back for terminating the main eventloop - print _("hud_main: Client destroyed") self.kill_hud(None, hud.table.name) def game_changed(self, widget, hud): diff --git a/pyfpdb/Hud.py b/pyfpdb/Hud.py index 56d184d5..ac22d893 100644 --- a/pyfpdb/Hud.py +++ b/pyfpdb/Hud.py @@ -495,6 +495,22 @@ class Hud: return True + def up_update_table_position(self): +# callback for table moved + +# move the stat windows + adj = self.adj_seats(self.hand, self.config) + loc = self.config.get_locations(self.table.site, self.max) + for i, w in enumerate(self.stat_windows.itervalues()): + (x, y) = loc[adj[i+1]] + w.relocate(x, y) +# move the main window + self.main_window.move(self.table.x + self.site_params['xshift'], self.table.y + self.site_params['yshift']) +# and move any auxs + for aux in self.aux_windows: + aux.update_card_positions() + return True + def on_button_press(self, widget, event): if event.button == 1: # if primary button, start movement self.main_window.begin_move_drag(event.button, int(event.x_root), int(event.y_root), event.time) @@ -630,8 +646,8 @@ class Hud: [config.supported_games[self.poker_game].stats[stat].col] = \ config.supported_games[self.poker_game].stats[stat].stat_name - if os.name == "nt": # we call update_table_position() regularly in Windows to see if we're moving around. See comments on that function for why this isn't done in X. - gobject.timeout_add(500, self.update_table_position) +# if os.name == "nt": # we call update_table_position() regularly in Windows to see if we're moving around. See comments on that function for why this isn't done in X. +# gobject.timeout_add(500, self.update_table_position) def update(self, hand, config): self.hand = hand # this is the last hand, so it is available later diff --git a/pyfpdb/TableWindow.py b/pyfpdb/TableWindow.py index ec694c73..d780bdbc 100644 --- a/pyfpdb/TableWindow.py +++ b/pyfpdb/TableWindow.py @@ -245,7 +245,7 @@ class Table_Window(object): return "client_destroyed" if self.x != new_geo['x'] or self.y != new_geo['y']: # window moved - print self.x, self.y, new_geo['x'], new_geo['y'] +# print self.x, self.y, new_geo['x'], new_geo['y'] self.x = new_geo['x'] self.y = new_geo['y'] return "client_moved" diff --git a/pyfpdb/WinTables.py b/pyfpdb/WinTables.py index f6ddd93b..b7114ae3 100644 --- a/pyfpdb/WinTables.py +++ b/pyfpdb/WinTables.py @@ -59,7 +59,7 @@ class Table(Table_Window): for hwnd in titles: if titles[hwnd] == "": continue - if re.search(self.search_string, titles[hwnd]): + if re.search(self.search_string, titles[hwnd], re.I): if self.check_bad_words(titles[hwnd]): continue self.window = hwnd diff --git a/pyfpdb/locale/fpdb-hu_HU.po b/pyfpdb/locale/fpdb-hu_HU.po index 36fd874c..d3e438e0 100644 --- a/pyfpdb/locale/fpdb-hu_HU.po +++ b/pyfpdb/locale/fpdb-hu_HU.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.20.905 plus git\n" "POT-Creation-Date: 2010-11-07 14:35+CET\n" -"PO-Revision-Date: 2010-10-03 01:26+0200\n" +"PO-Revision-Date: 2010-11-10 10:26+0100\n" "Last-Translator: Ferenc Erki \n" "Language-Team: Hungarian \n" "Language: hu\n" @@ -45,12 +45,11 @@ msgstr "re_HandInfo nem illeszkedik" #: AbsoluteToFpdb.py:201 msgid "File name didn't match re_*InfoFromFilename" -msgstr "" +msgstr "A fájlnév nem illeszkedik re_*InfoFromFilename-re" #: AbsoluteToFpdb.py:202 -#, fuzzy msgid "File name: %s" -msgstr "Fájlnév:" +msgstr "Fájlnév: %s" #: AbsoluteToFpdb.py:270 EverleafToFpdb.py:213 FulltiltToFpdb.py:346 #: OnGameToFpdb.py:303 PokerStarsToFpdb.py:346 Win2dayToFpdb.py:203 @@ -346,23 +345,20 @@ msgid "warning: index %s_%s_idx not dropped %s, continuing ..." msgstr "figyelem: a(z) %s_%s_idx index nem lett eldobva: %s, folytatás ..." #: Database.py:1071 Database.py:1079 -#, fuzzy msgid "Creating foreign key " -msgstr "idegen kulcs létrehozása: " +msgstr "idegen kulcs létrehozása " #: Database.py:1077 Database.py:1086 Database.py:1098 -#, fuzzy msgid "Create foreign key failed: " -msgstr " idegen kulcs létrehozása sikertelen: " +msgstr "idegen kulcs létrehozása sikertelen: " #: Database.py:1093 Database.py:1250 Database.py:1251 msgid "Creating mysql index %s %s" msgstr "MySQL index létrehozása: %s %s" #: Database.py:1102 -#, fuzzy msgid "Creating pg index " -msgstr "pg index létrehozása: " +msgstr "pg index létrehozása " #: Database.py:1107 Database.py:1256 Database.py:1265 Database.py:1273 msgid "Create index failed: " @@ -715,9 +711,9 @@ msgid "Unable to locate currency" msgstr "Nem található a pénznem" #: FulltiltToFpdb.py:223 -#, fuzzy msgid "readHandInfo: Unable to recognise handinfo from: '%s'" -msgstr "Nem sikerült felismerni a játéktípust innen: '%s'" +msgstr "" +"readHandInfo: Nem sikerült felismerni a leosztásinformációkat innen: '%s'" #: FulltiltToFpdb.py:356 msgid "Player bringing in: %s for %s" @@ -1292,23 +1288,20 @@ msgid "Non-showdown: $%.2f" msgstr "Mutatás nélkül: $%.2f" #: GuiGraphViewer.py:234 -#, fuzzy msgid "" "Hands: %d\n" "Profit (%s): %.2f" msgstr "" "Leosztások: %d\n" -"Profit: $%.2f" +"Profit (%s): %.2f" #: GuiGraphViewer.py:236 -#, fuzzy msgid "Showdown (%s): %.2f" -msgstr "Mutatással: $%.2f" +msgstr "Mutatással (%s): %.2f" #: GuiGraphViewer.py:238 -#, fuzzy msgid "Non-showdown (%s): %.2f" -msgstr "Mutatás nélkül: $%.2f" +msgstr "Mutatás nélkül (%s): %.2f" #: GuiGraphViewer.py:356 GuiTourneyGraphViewer.py:276 msgid "Please choose the directory you wish to export to:" @@ -1425,128 +1418,135 @@ msgstr "Beállítások" #: GuiRingPlayerStats.py:44 msgid "Type of Game" -msgstr "" +msgstr "Játék típusa" #: GuiRingPlayerStats.py:45 msgid "Hole cards" -msgstr "" +msgstr "Osztott lapok" #: GuiRingPlayerStats.py:46 -#, fuzzy msgid "Position" -msgstr "Pozíciós statisztikák" +msgstr "Pozíció" #: GuiRingPlayerStats.py:47 -#, fuzzy msgid "Name of the player" -msgstr "Játékosok száma:" +msgstr "Játékos neve" #: GuiRingPlayerStats.py:48 -#, fuzzy msgid "Number of hands played" -msgstr "Leosztások száma:" +msgstr "Leosztások száma" #: GuiRingPlayerStats.py:49 -#, fuzzy msgid "Number of Seats" -msgstr "Szálak száma:" +msgstr "Székek száma" #: GuiRingPlayerStats.py:50 -#, fuzzy msgid "" "Voluntarily Putting In the pot\n" "(blinds excluded)" -msgstr "önként befizet preflop %" +msgstr "" +"Önként befizet preflop\n" +"(vakok kivételével)" #: GuiRingPlayerStats.py:51 -#, fuzzy msgid "% Pre Flop Raise" msgstr "preflop emelés" #: GuiRingPlayerStats.py:52 -#, fuzzy msgid "% Pre Flop Re-Raise / 3Bet" -msgstr "preflop emelés" +msgstr "preflop visszaemelés / 3bet" #: GuiRingPlayerStats.py:53 -#, fuzzy msgid "Aggression Factor\n" -msgstr "agresszió faktor" +msgstr "agresszió faktor\n" #: GuiRingPlayerStats.py:54 msgid "" "Aggression Frequency\n" "Bet or Raise vs Fold" msgstr "" +"aggresszió gyakoriság\n" +"bet vagy raise vs fold" #: GuiRingPlayerStats.py:55 -#, fuzzy msgid "Continuation Bet on the flop" -msgstr "folytató nyitás flopon/4. utcán %" +msgstr "folytató nyitás flopon" #: GuiRingPlayerStats.py:56 msgid "% Raise First In\\% Raise when first to bet" -msgstr "" +msgstr "nyitóemelés" #: GuiRingPlayerStats.py:57 msgid "" "% First to raise pre-flop\n" "and steal blinds" msgstr "" +"nyitóemelés preflop\n" +"és vaklopás" #: GuiRingPlayerStats.py:58 msgid "% Saw Flop vs hands dealt" -msgstr "" +msgstr "flopot néz vs leosztások" #: GuiRingPlayerStats.py:59 msgid "Saw Show Down / River" -msgstr "" +msgstr "terítésig megy / river" #: GuiRingPlayerStats.py:60 msgid "Went To Show Down When Saw Flop" -msgstr "" +msgstr "terítésig megy, ha flopot nézett" #: GuiRingPlayerStats.py:61 msgid "Amount Won when Show Down seen" -msgstr "" +msgstr "nyeremény, amikor terítésig ment" #: GuiRingPlayerStats.py:62 msgid "" "Flop Aggression\n" "% Bet or Raise after seeing Flop" msgstr "" +"flop aggresszió\n" +"bet vagy raise a flop láttán" #: GuiRingPlayerStats.py:63 msgid "" "Turn Aggression\n" "% Bet or Raise after seeing Turn" msgstr "" +"turn aggresszió\n" +"bet vagy raise a turn láttán" #: GuiRingPlayerStats.py:64 msgid "" "River Aggression\n" "% Bet or Raise after seeing River" msgstr "" +"river aggresszió\n" +"bet vagy raise a river láttán" #: GuiRingPlayerStats.py:65 msgid "" "Coming Soon\n" "Total % agression" msgstr "" +"hamarosan\n" +"totál aggresszió" #: GuiRingPlayerStats.py:66 msgid "Amount won" -msgstr "" +msgstr "nyeremény" #: GuiRingPlayerStats.py:67 msgid "" "Number of Big Blinds won\n" "or lost per 100 hands" msgstr "" +"átlagosan nyert nagyvakok\n" +"100 leosztásonként" #: GuiRingPlayerStats.py:68 msgid "Amount of rake paid" -msgstr "" +msgstr "Fizetett jutalék" #: GuiRingPlayerStats.py:69 msgid "" @@ -1554,12 +1554,17 @@ msgid "" "or lost per 100 hands\n" "when excluding rake" msgstr "" +"átlagosan nyert nagyvakok\n" +"100 leosztásonként,\n" +"ha leszámítjuk a jutalékot" #: GuiRingPlayerStats.py:70 msgid "" "Measure of uncertainty\n" "The lower, the more stable the amounts won" msgstr "" +"A bizonytalanság mértéke\n" +"Minél kisebb, annál stabilabb a nyeremény" #: GuiRingPlayerStats.py:347 GuiSessionViewer.py:239 #: GuiTourneyPlayerStats.py:243 @@ -2469,17 +2474,16 @@ msgid "Print version information and exit." msgstr "Verzióinformáció kiírása, majd kilépés." #: Options.py:57 -#, fuzzy msgid "Input out path in quiet mode" -msgstr "Fájl feldolgozása csendes módban" +msgstr "Könyvtár beolvasása csendes módban" #: Options.py:59 msgid "File to be split is a PokerStars or Full Tilt Poker archive file" -msgstr "" +msgstr "A darabolandó fájl PokerStars vagy Full Tilt Poker archív fájl" #: Options.py:61 msgid "How many hands do you want saved to each file. Default is 100" -msgstr "" +msgstr "Ennyi leosztásonként daraboljon. Alapértelmezetten 100" #: Options.py:73 msgid "press enter to end" @@ -2526,17 +2530,16 @@ msgid "failed to detect currency" msgstr "nem sikerült a pénznem meghatározása" #: SplitHandHistory.py:76 -#, fuzzy msgid "File not found" -msgstr "Az asztal nem található." +msgstr "Fájl nem található" #: SplitHandHistory.py:126 msgid "Unexpected error processing file" -msgstr "" +msgstr "Váratlan hiba a fájl feldolgozása közben" #: SplitHandHistory.py:165 msgid "End of file reached" -msgstr "" +msgstr "Fájl vége" #: Stats.py:127 Stats.py:128 msgid "Total Profit" @@ -2949,15 +2952,16 @@ msgid "" "This module was developed and tested with version 2.8.18 of gtk. You are " "using version %d.%d.%d. Your milage may vary." msgstr "" +"Ez a modul a gtk 2.8.18 verziójával lett fejlesztve és tesztelve. Te most a " +"%d.%d.%d verziót használod. Lehet, hogy máshogy fog működni." #: WinTables.py:73 msgid "self.window doesn't exist? why?" msgstr "self.window nem létezik? miért?" #: WinamaxToFpdb.py:233 -#, fuzzy msgid "Failed to add streets. handtext=%s" -msgstr "Nem sikerült a leosztás elküldése a HUD számára: %s" +msgstr "Nem sikerült az utcák hozzáadása. handtext=%s" #: fpdb.pyw:39 msgid " - press return to continue\n" diff --git a/pyfpdb/xlib_tester.py b/pyfpdb/xlib_tester.py new file mode 100755 index 00000000..66a180d0 --- /dev/null +++ b/pyfpdb/xlib_tester.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +"""Test program to see if XTables.py will correctly id the poker client. +""" +# Copyright 2010, Ray E. Barker + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# ====EXAMPLE OUTPUT FROM MY SYSTEM==== +#enter table xid find (in hex): +#0x3600018 <---GET THIS BY RUNNING xwininfo FROM A TERMINAL. +#Window information from xwininfo: +#------------------------------------------------------- +# +#xwininfo: Window id: 0x3600018 "Baseline Rd(26128925) - $100/$200 - Limit Hold'em" +# +# Root window id: 0x107 (the root window) (has no name) +# Parent window id: 0xe6e0a2 (has no name) +# 1 child: +# 0x3600019 (has no name): () 792x573+0+0 +2171+192 +# +# +#------------------------------------------------------- +# +# +#Window information from functions: +#matched inside +#window = Xlib.display.Window(0x03600018) title = "Baseline Rd(26128925) - $100/$200 - Limit Hold'em" +# +#parent = Xlib.display.Window(0x00e6e0a2) + +import sys +import os +import re + +# Other Library modules +import Xlib.display + +disp = Xlib.display.Display() +root = disp.screen().root +name_atom = disp.get_atom("WM_NAME", 1) + +def get_window_from_xid(id): + for outside in root.query_tree().children: + if outside.id == id: + print "matched outside" + return outside + for inside in outside.query_tree().children: + if inside.id == id: + print "matched inside" + return inside + return None + +def get_window_title(xid): + s = os.popen("xwininfo -children -id %d" % xid).read() + mo = re.search('"(.+)"', s) + try: + return mo.group(1) + except AttributeError: + return None + +if __name__== "__main__": + + print "enter table xid find (in hex): " + xid = sys.stdin.readline() + + print "Window information from xwininfo:" + s = os.popen("xwininfo -children -id %d" % int(xid, 0)).read() + print "-------------------------------------------------------" + print s + print "-------------------------------------------------------\n\n" + + print "Window information from functions:" + window = get_window_from_xid(int(xid, 0)) + print "window =", window, "title = \"" + get_window_title(int(xid, 0)) + "\"\n" + + print "parent =", window.query_tree().parent