Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gepetto
Gepetto Utils
Commits
c5f1620d
Unverified
Commit
c5f1620d
authored
Nov 10, 2021
by
Guilhem Saurel
Committed by
GitHub
Nov 10, 2021
Browse files
Merge pull request #6 from TLasguignes/master
script offices: update of november arrivals and departures
parents
2b9c0ed6
6f810eaa
Changes
2
Hide whitespace changes
Inline
Side-by-side
scripts/data/offices-ldap.json
View file @
c5f1620d
{
"B181"
:
[
[
"Bury"
,
"Diane"
],
[
"Fourmy"
,
"Médéric"
...
...
@@ -67,6 +71,14 @@
[
"Lasguignes"
,
"Thibaud"
],
[
"Marsan"
,
"Thibault"
],
[
"Naveau"
,
"Maximilien"
]
],
"B67"
:
[
...
...
@@ -74,9 +86,21 @@
"Fadini"
,
"Gabriele"
],
[
"Jallet"
,
"Wilson"
],
[
"Leziart"
,
"Pierre-Alexandre"
],
[
"Perrot"
,
"Côme"
],
[
"Romualdi"
,
"Giulio"
]
],
"B69.1"
:
[
...
...
@@ -120,11 +144,5 @@
"Mansard"
,
"Nicolas"
]
],
"BSalleGerardBauzil"
:
[
[
"Sosnowski"
,
"Vinicius"
]
]
}
\ No newline at end of file
scripts/offices.py
View file @
c5f1620d
...
...
@@ -84,11 +84,10 @@ class Offices:
# Stuff that is wrong in LDAP… We should fix that there
WRONG_OFFICE
=
{
'Exterieur'
:
{(
'Steve'
,
'Tonneau'
)},
'B67'
:
{(
'Michel'
,
'Aractingi'
)},
'Exterieur'
:
{(
'Steve'
,
'Tonneau'
),
(
'Nils'
,
'Hareng'
)},
'B69.1'
:
{(
'Guilhem'
,
'Saurel'
),
(
'Pierre'
,
'Fernbach'
)},
'B90'
:
{(
'Nicolas'
,
'Mansard'
)},
'B
181
'
:
{(
'
Bury'
,
'Diane
'
)},
'B
69.2
'
:
{(
'
D. V. Thanh'
,
'Nguyen
'
)},
}
WRONG_OFFICE
=
{
k
:
{
Gepettist
(
sn
,
gn
)
for
(
gn
,
sn
)
in
v
}
for
k
,
v
in
WRONG_OFFICE
.
items
()}
# Fix unicode from LDAP data…
...
...
@@ -109,7 +108,12 @@ def door_label(members, logo=True):
with
Image
(
filename
=
LOGO
)
as
logo
:
logo
.
transform
(
resize
=
f
'
{
WIDTH
}
x
{
HEIGHT
}
'
)
draw
.
composite
(
'over'
,
200
,
0
,
logo
.
width
,
logo
.
height
,
logo
)
draw
.
font_size
=
80
if
len
(
members
)
>=
4
else
90
if
len
(
members
)
>
4
:
draw
.
font_size
=
70
elif
len
(
members
)
==
4
:
draw
.
font_size
=
80
else
:
draw
.
font_size
=
90
draw
.
text_alignment
=
'center'
height
=
HEIGHT
-
len
(
members
)
*
draw
.
font_size
draw
.
text
(
int
(
WIDTH
/
2
),
int
(
height
/
2
)
+
65
,
'
\n
'
.
join
(
str
(
m
)
for
m
in
sorted
(
members
)))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment