Example #1
0
 def test_load_themes_from(self):
     test_path = join(self.TESTS, 'themes')
     themes_iter = load_themes_from(test_path)
     themes = list(sorted(themes_iter, key=attrgetter('identifier')))
     self.assertEqual(themes[0].identifier, 'cool')
     self.assertEqual(themes[1].identifier, 'notthis')
     self.assertEqual(themes[2].identifier, 'plain')
Example #2
0
 def test_load_themes_from(self):
     test_path = join(self.TESTS, 'themes')
     themes_iter = load_themes_from(test_path)
     themes = list(sorted(themes_iter, key=attrgetter('identifier')))
     self.assertEqual(themes[0].identifier, 'cool')
     self.assertEqual(themes[1].identifier, 'notthis')
     self.assertEqual(themes[2].identifier, 'plain')
Example #3
0
File: views.py Project: pib/piblog
def instance_theme_loader(app):
    themes_dir = os.path.join(app.instance_path, 'themes')
    if os.path.isdir(themes_dir):
        return load_themes_from(themes_dir)
    else:
        return ()
Example #4
0
File: views.py Project: pib/piblog
def instance_theme_loader(app):
    themes_dir = os.path.join(app.instance_path, 'themes')
    if os.path.isdir(themes_dir):
        return load_themes_from(themes_dir)
    else:
        return ()