<commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals

import os
from django.apps import apps, AppConfig


APPS_INCLUDE_DIRS = []

class SassProcessorConfig(AppConfig):
    name = 'sass_processor'
    verbose_name = "Sass Processor"
    _static_dir = 'static'
    _sass_exts = ('.scss', '.sass')

    def ready(self):
        app_configs = apps.get_app_configs()
        for app_config in app_configs:
            static_dir = os.path.join(app_config.path, self._static_dir)
            if os.path.isdir(static_dir):
                self.traverse_tree(static_dir)

        print(APPS_INCLUDE_DIRS)

    @classmethod
    def traverse_tree(cls, static_dir):<commit_msg>Use StaticFileStorage to determine source directories<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals

import os
from django.apps import apps, AppConfig
from django.conf import settings
from django.core.files.storage import get_storage_class


APPS_INCLUDE_DIRS = []

class SassProcessorConfig(AppConfig):
    name = 'sass_processor'
    verbose_name = "Sass Processor"
    _sass_exts = ('.scss', '.sass')
    _storage = get_storage_class(import_path=settings.STATICFILES_STORAGE)()

    def ready(self):
        app_configs = apps.get_app_configs()
        for app_config in app_configs:
            static_dir = os.path.join(app_config.path, self._storage.base_url.strip(os.path.sep))
            if os.path.isdir(static_dir):
                self.traverse_tree(static_dir)

    @classmethod
    def traverse_tree(cls, static_dir):
{'fraction_non_alphanumeric': 0.0978120978120978, 'fraction_numerical': 0.001287001287001287, 'mean_word_length': 3.405099150141643, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2189127', 'n_tokens_mistral': 524, 'n_tokens_neox': 498, 'n_words': 103}