From 7c4337bd9630e0a6c0b3de664d9053ac507584a6 Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 11 Feb 2011 17:50:07 +0800 Subject: [PATCH] Config: Add ResultsDirectory to --- pyfpdb/Configuration.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index a25b13eb..365f7c4a 100644 --- a/pyfpdb/Configuration.py +++ b/pyfpdb/Configuration.py @@ -483,6 +483,7 @@ class Import: 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) self.cacheSessions = string_to_bool(node.getAttribute("cacheSessions"), default=False) @@ -491,8 +492,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\n" \ - % (self.interval, self.callFpdbHud, self.hhArchiveBase, self.saveActions, self.cacheSessions, self.sessionTimeout, self.fastStoreHudCache) + 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) class HudUI: def __init__(self, node): @@ -1261,6 +1262,14 @@ class Config: 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 + if self.imp.ResultsDirectory != '': + imp['ResultsDirectory'] = self.imp.ResultsDirectory + else: + imp['ResultsDirectory'] = "~/.fpdb/Results/" + # hhBulkPath is the default location for bulk imports (if set) try: imp['hhBulkPath'] = self.imp.hhBulkPath except: imp['hhBulkPath'] = ""