Beispiel #1
0
    def __init__(self, config, site, table_name = None, tournament = None, table_number = None):

        self.config = config
        self.site = site
        if tournament is not None and table_number is not None:
            self.tournament = int(tournament)
            self.table = int(table_number)
            self.name = "%s - %s" % (self.tournament, self.table)
            self.type = "tour"
            table_kwargs = dict(tournament = self.tournament, table_number = self.table)
            self.tableno_re = getTableNoRe(self.config, self.site, tournament = self.tournament)
        elif table_name is not None:
            self.name = table_name
            self.type = "cash"
            self.tournament = None
            table_kwargs = dict(table_name = table_name)

        else:
            return None

        self.search_string = getTableTitleRe(self.config, self.site, self.type, **table_kwargs)
        self.find_table_parameters()

        geo = self.get_geometry()
        if geo is None:  return None
        self.width  = geo['width']
        self.height = geo['height']
        self.x      = geo['x']
        self.y      = geo['y']
        self.oldx   = self.x # attn ray: remove these two lines and update Hud.py::update_table_position()
        self.oldy   = self.y

        self.game = self.get_game()
Beispiel #2
0
    def __init__(self,
                 config,
                 site,
                 table_name=None,
                 tournament=None,
                 table_number=None):

        self.config = config
        self.site = site
        self.hud = None  # fill in later
        self.gdkhandle = None
        self.number = None
        if tournament is not None and table_number is not None:
            self.tournament = int(tournament)
            self.table = int(table_number)
            self.name = "%s - %s" % (self.tournament, self.table)
            self.type = "tour"
            table_kwargs = dict(tournament=self.tournament,
                                table_number=self.table)
            self.tableno_re = getTableNoRe(self.config,
                                           self.site,
                                           tournament=self.tournament)
        elif table_name is not None:
            self.name = table_name
            self.type = "cash"
            self.tournament = None
            table_kwargs = dict(table_name=table_name)

        else:
            return None

        self.search_string = getTableTitleRe(self.config, self.site, self.type,
                                             **table_kwargs)
        trys = 0
        while True:
            self.find_table_parameters()
            if self.number is not None: break
            trys += 1
            if trys > 4:
                log.error(_("Can't find table %s") % table_name)
                return None

        geo = self.get_geometry()
        if geo is None: return None
        self.width = geo['width']
        self.height = geo['height']
        self.x = geo['x']
        self.y = geo['y']
        self.oldx = self.x  # attn ray: remove these two lines and update Hud.py::update_table_position()
        self.oldy = self.y

        self.game = self.get_game()
Beispiel #3
0
    def __init__(self,
                 config,
                 site,
                 table_name=None,
                 tournament=None,
                 table_number=None):

        self.config = config
        self.site = site
        self.hud = None  # fill in later
        self.gdkhandle = None
        self.number = None
        if tournament is not None and table_number is not None:
            self.tournament = int(tournament)
            self.table = int(table_number)
            self.name = "%s - %s" % (self.tournament, self.table)
            self.type = "tour"
            table_kwargs = dict(tournament=self.tournament,
                                table_number=self.table)
            self.tableno_re = getTableNoRe(self.config,
                                           self.site,
                                           tournament=self.tournament)
        elif table_name is not None:
            self.name = table_name
            self.type = "cash"
            self.tournament = None
            table_kwargs = dict(table_name=table_name)

        else:
            return None

        self.search_string = getTableTitleRe(self.config, self.site, self.type,
                                             **table_kwargs)
        # make a small delay otherwise Xtables.root.get_windows()
        #  returns empty for unknown reasons
        sleep(0.1)

        self.find_table_parameters()
        if not self.number:
            log.error(_("Can't find table \"%s\" with search string \"%s\""),
                      table_name, self.search_string)

        geo = self.get_geometry()
        if geo is None: return None
        self.width = geo['width']
        self.height = geo['height']
        self.x = geo['x']
        self.y = geo['y']
        self.oldx = self.x  # attn ray: remove these two lines and update Hud.py::update_table_position()
        self.oldy = self.y

        self.game = self.get_game()
Beispiel #4
0
    def __init__(self, config, site, table_name = None, tournament = None, table_number = None):

        self.config = config
        self.site = site
        self.hud = None   # fill in later
        self.gdkhandle = None
        self.number = None
        if tournament is not None and table_number is not None:
            self.tournament = int(tournament)
            self.table = int(table_number)
            self.name = "%s - %s" % (self.tournament, self.table)
            self.type = "tour"
            table_kwargs = dict(tournament = self.tournament, table_number = self.table)
            self.tableno_re = getTableNoRe(self.config, self.site, tournament = self.tournament)
        elif table_name is not None:
            self.name = table_name
            self.type = "cash"
            self.tournament = None
            table_kwargs = dict(table_name = table_name)

        else:
            return None

        self.search_string = getTableTitleRe(self.config, self.site, self.type, **table_kwargs)
        # make a small delay otherwise Xtables.root.get_windows()
        #  returns empty for unknown reasons
        sleep(0.1)
        
        self.find_table_parameters()
        if not self.number:
            log.error(_("Can't find table %s") % table_name)


        geo = self.get_geometry()
        if geo is None:  return None
        self.width  = geo['width']
        self.height = geo['height']
        self.x      = geo['x']
        self.y      = geo['y']
        self.oldx   = self.x # attn ray: remove these two lines and update Hud.py::update_table_position()
        self.oldy   = self.y

        self.game = self.get_game()