Fixed folder couldn't be displayed error in BulkImport

This commit is contained in:
grindi 2009-08-08 12:07:30 +04:00
parent 25be578e7d
commit 88d67dc429

View File

@ -1,4 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Configuration.py """Configuration.py
Handles HUD configuration files. Handles HUD configuration files.
@ -543,6 +544,13 @@ class Config:
if db_type != None: self.supported_databases[db_name].dp_type = db_type if db_type != None: self.supported_databases[db_name].dp_type = db_type
return return
def getDefaultSite(self):
"Returns first enabled site or None"
for site_name,site in self.supported_sites.iteritems():
if site.enabled:
return site_name
return None
def get_tv_parameters(self): def get_tv_parameters(self):
tv = {} tv = {}
try: tv['combinedStealFold'] = self.tv.combinedStealFold try: tv['combinedStealFold'] = self.tv.combinedStealFold
@ -573,14 +581,15 @@ class Config:
except: imp['fastStoreHudCache'] = True except: imp['fastStoreHudCache'] = True
return imp return imp
def get_default_paths(self, site = "PokerStars"): def get_default_paths(self, site = None):
if site is None: site = self.getDefaultSite()
paths = {} paths = {}
try: try:
paths['hud-defaultPath'] = os.path.expanduser(self.supported_sites[site].HH_path) path = os.path.expanduser(self.supported_sites[site].HH_path)
paths['bulkImport-defaultPath'] = os.path.expanduser(self.supported_sites[site].HH_path) assert(os.path.isdir(path) or os.path.isfile(path)) # maybe it should try another site?
paths['hud-defaultPath'] = paths['bulkImport-defaultPath'] = path
except: except:
paths['hud-defaultPath'] = "default" paths['hud-defaultPath'] = paths['bulkImport-defaultPath'] = "default"
paths['bulkImport-defaultPath'] = "default"
return paths return paths
def get_frames(self, site = "PokerStars"): def get_frames(self, site = "PokerStars"):