Projet

Général

Profil

0001-build-switch-everything-to-Python-3-41347.patch

Frédéric Péters, 06 avril 2020 10:40

Télécharger (6,87 ko)

Voir les différences:

Subject: [PATCH] build: switch everything to Python 3 (#41347)

 Makefile                      | 30 +++++++++++++++---------------
 debian/control                |  2 +-
 get_themes.py                 |  4 ++--
 make_data_uris.py             |  6 +++---
 src/render-imgs-categories.py |  2 +-
 src/render-imgs-dashboard.py  |  2 +-
 6 files changed, 23 insertions(+), 23 deletions(-)
Makefile
6 6
all: themes.json icons css
7 7

  
8 8
static/includes/_data_uris.scss: $(wildcard static/includes/img/*)
9
	python make_data_uris.py static/includes/
9
	python3 make_data_uris.py static/includes/
10 10

  
11 11
static/toodego/_data_uris.scss: $(wildcard static/toodego/img/*)
12
	python make_data_uris.py static/toodego/
12
	python3 make_data_uris.py static/toodego/
13 13

  
14 14
static/lille/_data_uris.scss: $(wildcard static/lille/img/*)
15
	python make_data_uris.py static/lille/
15
	python3 make_data_uris.py static/lille/
16 16

  
17 17
static/lomme/_data_uris.scss: $(wildcard static/lomme/img/*)
18
	python make_data_uris.py static/lomme/
18
	python3 make_data_uris.py static/lomme/
19 19

  
20 20
static/hellemmes/_data_uris.scss: $(wildcard static/hellemmes/img/*)
21
	python make_data_uris.py static/hellemmes/
21
	python3 make_data_uris.py static/hellemmes/
22 22

  
23 23
themes.json: $(wildcard static/*/config.json) help/fr/misc-scss.page
24 24
	python3 create_themes_json.py
......
28 28
%.css: %.scss $(wildcard static/includes/*.scss  static/includes/*/*.scss) static/includes/_data_uris.scss static/lille/_data_uris.scss static/lomme/_data_uris.scss static/hellemmes/_data_uris.scss static/toodego/_data_uris.scss $$(wildcard $$(@D)/*.scss)
29 29
	sassc --sourcemap $< $@
30 30

  
31
css: $(shell python get_themes.py) static/portal-agent/css/agent-portal.css
31
css: $(shell python3 get_themes.py) static/portal-agent/css/agent-portal.css
32 32
	rm -rf static/*/.sass-cache/
33 33

  
34 34
icons:
35 35
	# chateauroux
36
	cd src/ && python render-imgs-dashboard.py ../static/chateauroux/img/ --normal 333333 --selected 0779B7 --title FFFFFF --title-width 80
36
	cd src/ && python3 render-imgs-dashboard.py ../static/chateauroux/img/ --normal 333333 --selected 0779B7 --title FFFFFF --title-width 80
37 37
	# orleans
38
	cd src/ && python render-imgs-categories.py ../static/orleans/img/ --primary f05923 --secondary 34697D
39
	cd src/ && python render-imgs-dashboard.py ../static/orleans/img/ --normal FFFFFF --normal-width 30 --selected f05923 --selected-width 30 --title FFFFFF --title-width 80
38
	cd src/ && python3 render-imgs-categories.py ../static/orleans/img/ --primary f05923 --secondary 34697D
39
	cd src/ && python3 render-imgs-dashboard.py ../static/orleans/img/ --normal FFFFFF --normal-width 30 --selected f05923 --selected-width 30 --title FFFFFF --title-width 80
40 40
	# publik
41
	cd src/ && python render-imgs-categories.py ../static/publik/img/
42
	cd src/ && python render-imgs-dashboard.py ../static/publik/img/ --normal 4D4D4D --selected DF017A --title FFFFFF --title-width 80
41
	cd src/ && python3 render-imgs-categories.py ../static/publik/img/
42
	cd src/ && python3 render-imgs-dashboard.py ../static/publik/img/ --normal 4D4D4D --selected DF017A --title FFFFFF --title-width 80
43 43
	# somme
44
	cd src/ && python render-imgs-categories.py ../static/somme-cd80/img/ --primary A8002B --secondary A8002B
45
	cd src/ && python render-imgs-dashboard.py ../static/somme-cd80/img/ --normal 4D4D4D --selected 87A738 --title FFFFFF --title-width 80
46
	cd src/ && python render-imgs-categories.py ../static/hautes-alpes-2018/img/icon-rouge --primary B73720 --secondary B73720
47
	cd src/ && python render-imgs-categories.py ../static/hautes-alpes-2018/img/icon-bleu --primary 1C515E --secondary 1C515E
44
	cd src/ && python3 render-imgs-categories.py ../static/somme-cd80/img/ --primary A8002B --secondary A8002B
45
	cd src/ && python3 render-imgs-dashboard.py ../static/somme-cd80/img/ --normal 4D4D4D --selected 87A738 --title FFFFFF --title-width 80
46
	cd src/ && python3 render-imgs-categories.py ../static/hautes-alpes-2018/img/icon-rouge --primary B73720 --secondary B73720
47
	cd src/ && python3 render-imgs-categories.py ../static/hautes-alpes-2018/img/icon-bleu --primary 1C515E --secondary 1C515E
48 48
	# tournai
49 49
	cd static/tournai/ && for F in assets/*.svg; do inkscape --without-gui --file $$F --export-area-drawing --export-area-snap --export-png img/$$(basename $$F .svg).png --export-width 40; done
50 50

  
debian/control
8 8

  
9 9
Package: publik-base-theme
10 10
Architecture: all
11
Depends: ${shlibs:Depends}, ${misc:Depends}, python-gadjo
11
Depends: ${shlibs:Depends}, ${misc:Depends}, python-gadjo, python3-gadjo
12 12
Conflicts: python-authentic2 (< 2.1.20.742.gb6ee096-0),
13 13
           python-django (<= 1:1.11),
14 14
           python-xstatic-roboto-fontface (< 0.5.0.0),
get_themes.py
1
#! /usr/bin/env python
1
#! /usr/bin/env python3
2 2

  
3 3
import os
4 4

  
......
6 6
    config = os.path.join('static', dirname, 'config.json')
7 7
    if not os.path.exists(config):
8 8
        continue
9
    print 'static/%s/style.css' % dirname
9
    print('static/%s/style.css' % dirname)
make_data_uris.py
1
#! /usr/bin/env python
1
#! /usr/bin/env python3
2 2

  
3 3
import base64
4 4
import os
......
18 18
    filesize = os.stat('img/' + filename).st_size
19 19
    if filesize > 10000:
20 20
        continue
21
    filecontent = open('img/' + filename).read()
22
    b64 = base64.encodestring(filecontent).replace('\n', '')
21
    filecontent = open('img/' + filename, 'rb').read()
22
    b64 = base64.encodebytes(filecontent).decode('ascii').replace('\n', '')
23 23
    data_uris.append('$data_uri_%(varname)s: "data:%(mimetype)s;base64,%(b64)s" !default;' % locals())
24 24

  
25 25
open('_data_uris.scss', 'w').write('\n'.join(data_uris))
src/render-imgs-categories.py
1
#! /usr/bin/env python
1
#! /usr/bin/env python3
2 2

  
3 3
# publik-base-theme
4 4
# Copyright (C) 2016  Entr'ouvert
src/render-imgs-dashboard.py
1
#! /usr/bin/env python
1
#! /usr/bin/env python3
2 2

  
3 3
# publik-base-theme
4 4
# Copyright (C) 2016  Entr'ouvert
5
-