From 5c656625fd24c31b77bcd4f5f11c287b5187b231 Mon Sep 17 00:00:00 2001 From: fpdb-mme Date: Wed, 4 Nov 2009 23:41:09 +0100 Subject: [PATCH] combed a bit over Config.get_default_font() --- pyfpdb/Configuration.py | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index 4bf5cccb..489774e9 100755 --- a/pyfpdb/Configuration.py +++ b/pyfpdb/Configuration.py @@ -762,20 +762,16 @@ class Config: colors['hudfgcolor'] = self.supported_sites[site].hudfgcolor return colors - def get_default_font(self, site = 'PokerStars'): - (font, font_size) = ("Sans", "8") - if site not in self.supported_sites: - return ("Sans", "8") - if self.supported_sites[site].font == "": - font = "Sans" - else: - font = self.supported_sites[site].font - - if self.supported_sites[site].font_size == "": - font_size = "8" - else: - font_size = self.supported_sites[site].font_size - return (font, font_size) + def get_default_font(self, site='PokerStars'): + font = "Sans" + font_size = "8" + site = self.supported_sites.get(site, None) + if site is not None: + if site.font: + font = site.font + if site.font_size: + font_size = site.font_size + return font, font_size def get_locations(self, site = "PokerStars", max = "8"):