Small fix to themedata_for_theme_dir utility about sections
authorChristopher Allan Webber <cwebber@dustycloud.org>
Sun, 15 Jul 2012 03:44:06 +0000 (22:44 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sun, 15 Jul 2012 03:44:06 +0000 (22:44 -0500)
If we can't find the theme section, we should use a dictionary instead
of None in this section of code.

mediagoblin/tools/theme.py

index 4c7a7c0e693706a5047e6b45274ddeff89a1a00a..97b041a61a5cb2cb769dcbc9c21b51e591ddb7d6 100644 (file)
@@ -32,7 +32,7 @@ def themedata_for_theme_dir(name, theme_dir):
     Given a theme directory, extract important theme information.
     """
     # open config
-    config = ConfigObj(os.path.join(theme_dir, 'theme.ini')).get('theme')
+    config = ConfigObj(os.path.join(theme_dir, 'theme.ini')).get('theme', {})
 
     templates_dir = os.path.join(theme_dir, 'templates')
     if not os.path.exists(templates_dir):