diff --git a/pyfpdb/AlchemyMappings.py b/pyfpdb/AlchemyMappings.py index 53f59a1a..40e7a5e4 100644 --- a/pyfpdb/AlchemyMappings.py +++ b/pyfpdb/AlchemyMappings.py @@ -370,6 +370,7 @@ class Site(object): (10, 'Partouche', 'PA'), (11, 'Carbon', 'CA'), (12, 'PKR', 'PK'), + (13, 'PacificPoker', 'P8'), ] INITIAL_DATA_KEYS = ('id', 'name', 'code') diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index 4d468405..da22a363 100644 --- a/pyfpdb/Configuration.py +++ b/pyfpdb/Configuration.py @@ -78,7 +78,6 @@ def get_exec_path(): def get_config(file_name, fallback = True): """Looks in cwd and in self.default_config_path for a config file.""" - # look for example file even if not used here, path is returned to caller config_found,example_found,example_copy = False,False,False config_path, example_path = None,None @@ -88,17 +87,17 @@ def get_config(file_name, fallback = True): config_path = os.path.join(exec_dir, 'pyfpdb', file_name) else: config_path = os.path.join(exec_dir, file_name) -# print "config_path=", config_path + #print "config_path=", config_path if os.path.exists(config_path): # there is a file in the cwd config_found = True # so we use it else: # no file in the cwd, look where it should be in the first place default_dir = get_default_config_path() config_path = os.path.join(default_dir, file_name) -# print "config path 2=", config_path + #print "config path 2=", config_path if os.path.exists(config_path): config_found = True - -# Example configuration for debian package + + # Example configuration for debian package if os.name == 'posix': # If we're on linux, try to copy example from the place # debian package puts it; get_default_config_path() creates @@ -112,7 +111,14 @@ def get_config(file_name, fallback = True): msg = _("Config file has been created at %s.\n") % config_path logging.info(msg) except IOError: - pass + try: + example_path = file_name + '.example' + shutil.copyfile(example_path, config_path) + example_copy = True + msg = _("Config file has been created at %s.\n") % config_path + logging.info(msg) + except IOError: + pass # OK, fall back to the .example file, should be in the start dir elif os.path.exists(file_name + ".example"): @@ -485,7 +491,6 @@ class Import: self.node = node self.interval = node.getAttribute("interval") self.callFpdbHud = node.getAttribute("callFpdbHud") - self.hhArchiveBase = node.getAttribute("hhArchiveBase") self.ResultsDirectory = node.getAttribute("ResultsDirectory") self.hhBulkPath = node.getAttribute("hhBulkPath") self.saveActions = string_to_bool(node.getAttribute("saveActions"), default=False) @@ -495,8 +500,8 @@ class Import: self.saveStarsHH = string_to_bool(node.getAttribute("saveStarsHH"), default=False) def __str__(self): - return " interval = %s\n callFpdbHud = %s\n hhArchiveBase = %s\n saveActions = %s\n fastStoreHudCache = %s\nResultsDirectory = %s" \ - % (self.interval, self.callFpdbHud, self.hhArchiveBase, self.saveActions, self.cacheSessions, self.sessionTimeout, self.fastStoreHudCache, self.ResultsDirectory) + return " interval = %s\n callFpdbHud = %s\n saveActions = %s\n fastStoreHudCache = %s\nResultsDirectory = %s" \ + % (self.interval, self.callFpdbHud, self.saveActions, self.cacheSessions, self.sessionTimeout, self.fastStoreHudCache, self.ResultsDirectory) class HudUI: def __init__(self, node): @@ -861,9 +866,6 @@ class Config: return nodes_added - def set_hhArchiveBase(self, path): - self.imp.node.setAttribute("hhArchiveBase", path) - def find_default_conf(self): if os.name == 'posix': config_path = os.path.join(os.path.expanduser("~"), '.fpdb', 'default.conf') @@ -1261,10 +1263,6 @@ class Config: try: imp['interval'] = self.imp.interval except: imp['interval'] = 10 - # hhArchiveBase is the temp store for part-processed hand histories - should be redundant eventually - try: imp['hhArchiveBase'] = self.imp.hhArchiveBase - except: imp['hhArchiveBase'] = "~/.fpdb/HandHistories/" - # ResultsDirectory is the local cache for downloaded results # NOTE: try: except: doesn'tseem to be triggering # using if instead diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 4efc832f..5be34fe3 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1519,6 +1519,7 @@ class Database: c.execute("INSERT INTO Sites (name,code) VALUES ('Betfair', 'BF')") c.execute("INSERT INTO Sites (name,code) VALUES ('Absolute', 'AB')") c.execute("INSERT INTO Sites (name,code) VALUES ('PartyPoker', 'PP')") + c.execute("INSERT INTO Sites (name,code) VALUES ('PacificPoker', 'P8')") c.execute("INSERT INTO Sites (name,code) VALUES ('Partouche', 'PA')") c.execute("INSERT INTO Sites (name,code) VALUES ('Carbon', 'CA')") c.execute("INSERT INTO Sites (name,code) VALUES ('PKR', 'PK')") diff --git a/pyfpdb/HUD_config.test.xml b/pyfpdb/HUD_config.test.xml index f8a99ee3..fba76fe1 100644 --- a/pyfpdb/HUD_config.test.xml +++ b/pyfpdb/HUD_config.test.xml @@ -2,7 +2,7 @@ - +