Beispiel #1
0
    def __init__(self, *args, **kwargs):
        super(ComprehensiveThemeFinder, self).__init__(*args, **kwargs)

        theme_dir = getattr(settings, "COMPREHENSIVE_THEME_DIR", "")
        if not theme_dir:
            self.storage = None
            return

        if not isinstance(theme_dir, basestring):
            raise ImproperlyConfigured(
                "Your COMPREHENSIVE_THEME_DIR setting must be a string")

        root = Path(settings.PROJECT_ROOT)
        if root.name == "":
            root = root.parent

        component_dir = Path(theme_dir) / root.name
        static_dir = component_dir / "static"
        self.storage = CachedComprehensiveThemingStorage(location=static_dir)