• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DemocracyClub / aggregator-api / 4a8c9c44-75dc-47ae-996b-96f875bd925f

pending completion
4a8c9c44-75dc-47ae-996b-96f875bd925f

push

circleci

GitHub
Merge pull request #318 from DemocracyClub/dependabot/pip/django-cors-headers-3.13.0

339 of 405 relevant lines covered (83.7%)

0.84 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/aggregator/s3_lambda_storage.py
1
from pipeline.compilers.sass import SASSCompiler
×
2

3
from django.conf import settings
×
4
from django.contrib.staticfiles.storage import staticfiles_storage
×
5
from pipeline.storage import PipelineMixin
×
6
from django.contrib.staticfiles.storage import ManifestStaticFilesStorage
×
7

8

9
class StaticStorage(PipelineMixin, ManifestStaticFilesStorage):
×
10
    pass
×
11

12

13
class LambdaSASSCompiler(SASSCompiler):
×
14
    """
15
    Use libsass's python API for converting scss files to css.
16

17
    The normal SASSCompiler opens a subprocess to call scss, but this confuses
18
    lambda as the script isn't on the PATH.
19

20
    """
21

22
    def compile_file(self, infile, outfile, outdated=False, force=False):
×
23
        if not outdated:
×
24
            return open(outfile).read()
×
25
        import sass
×
26

27
        out_value = sass.compile(
×
28
            filename=infile,
29
            output_style="compressed",
30
            include_paths=settings.SASS_INCLUDE_PATHS,
31
        )
32
        if type(out_value) == bytes:
×
33
            out_value = out_value.decode("utf8")
×
34

35
        with staticfiles_storage.open(outfile, "w") as out:
×
36
            out.write(out_value)
×
37
        return out_value
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc