Moved window title re to HHC classes

Just redefine function getTableTitleRe in coresponding hhc for custom re
This commit is contained in:
grindi
2009-11-07 20:30:47 +03:00
parent f99c4baa8b
commit 9dd600702a
3 changed files with 35 additions and 13 deletions
+23
View File
@@ -506,3 +506,26 @@ or None if we fail to get the info """
def getTourney(self):
return self.tourney
@staticmethod
def getTableTitleRe(type, table_name=None, tournament = None, table_number=None):
"Returns string to search in windows titles"
if type=="tour":
return "%s.+Table\s%s" % (tournament, table_number)
else:
return table_name
def getTableTitleRe(config, sitename, *args, **kwargs):
"Returns string to search in windows titles for current site"
return getSiteHhc(config, sitename).getTableTitleRe(*args, **kwargs)
def getSiteHhc(config, sitename):
"Returns HHC class for current site"
hhcName = config.supported_sites[sitename].converter
hhcModule = __import__(hhcName)
return getattr(hhcModule, hhcName[:-6])