changeset 75:ac6688820528

Move font name to constants, for future configurablity
author Neil Muller <drnlmuller@gmail.com>
date Sun, 11 Sep 2011 18:26:39 +0200
parents daa04393bfc6
children a2694a024c83
files mamba/constants.py mamba/widgets/text.py
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mamba/constants.py	Sun Sep 11 18:14:08 2011 +0200
+++ b/mamba/constants.py	Sun Sep 11 18:26:39 2011 +0200
@@ -17,6 +17,9 @@
 # Keyboard constants
 ESCAPE_KEYS = (K_ESCAPE, K_q)
 
+# For easy access later
+DEFAULT_FONT = 'DejaVuSans.ttf'
+
 # Default command-line options
 DEFAULTS = {
     'debug': False,
--- a/mamba/widgets/text.py	Sun Sep 11 18:14:08 2011 +0200
+++ b/mamba/widgets/text.py	Sun Sep 11 18:26:39 2011 +0200
@@ -2,6 +2,7 @@
 
 from mamba.widgets.base import Widget
 from mamba.data import filepath
+from mamba.constants import DEFAULT_FONT
 
 class TextWidget(Widget):
     fontcache = {}
@@ -14,7 +15,7 @@
         self.prepare()
 
     def prepare(self):
-        self.fontname = 'DejaVuSans.ttf'
+        self.fontname = DEFAULT_FONT
         font = (self.fontname, self.fontsize)
         if font not in TextWidget.fontcache:
             fontfn = filepath('fonts/' + self.fontname)