Projet

Général

Profil

0001-build-generate-sourcemap-for-CSS-files-49794.patch

Frédéric Péters, 31 décembre 2020 15:10

Télécharger (2,64 ko)

Voir les différences:

Subject: [PATCH] build: generate sourcemap for CSS files (#49794)

 MANIFEST.in |  2 +-
 setup.py    | 16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)
MANIFEST.in
7 7
recursive-include data/themes/default/ *.html *.css *.png *.gif *.jpg *.js *.ezt *.xml
8 8
recursive-include data/themes/alto/ *.html *.css *.png *.gif *.jpg *.js *.ezt *.xml
9 9
recursive-include data/vendor/ *.dat
10
recursive-include wcs/qommon/static/ *.css *.scss *.png *.gif *.jpg *.js *.eot *.svg *.ttf *.woff
10
recursive-include wcs/qommon/static/ *.css *.scss *.png *.gif *.jpg *.js *.eot *.svg *.ttf *.woff *.map
11 11
recursive-include wcs/templates *.html *.txt
12 12
recursive-include wcs/qommon/templates *.html *.txt
setup.py
53 53
        pass
54 54

  
55 55
    def run(self):
56
        sass_bin = None
57
        for program in ('sassc', 'sass'):
58
            sass_bin = find_executable(program)
59
            if sass_bin:
60
                break
56
        sass_bin = find_executable('sassc')
61 57
        if not sass_bin:
62
            raise CompileError('A sass compiler is required but none was found.  See sass-lang.com for choices.')
58
            raise CompileError('sassc is required but was not found.')
63 59

  
64 60
        for path, dirnames, filenames in os.walk('wcs'):
65 61
            for filename in filenames:
......
67 63
                    continue
68 64
                if filename.startswith('_'):
69 65
                    continue
70
                subprocess.check_call([sass_bin, '%s/%s' % (path, filename),
66
                subprocess.check_call([
67
                    sass_bin,
68
                    '-mauto',
69
                    '%s/%s' % (path, filename),
71 70
                    '%s/%s' % (path, filename.replace('.scss', '.css'))])
72 71

  
73 72

  
......
97 96

  
98 97
def data_tree(destdir, sourcedir):
99 98
    extensions = ['.css', '.png', '.jpeg', '.jpg', '.gif', '.xml', '.html',
100
            '.js', '.ezt', '.dat', '.eot', '.svg', '.ttf', '.woff']
99
            '.js', '.ezt', '.dat', '.eot', '.svg', '.ttf', '.woff', '.scss',
100
            '.map']
101 101
    r = []
102 102
    for root, dirs, files in os.walk(sourcedir):
103 103
        l = [os.path.join(root, x) for x in files if os.path.splitext(x)[1] in extensions]
104
-