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
96669b61
Unverified
Commit
96669b61
authored
Feb 28, 2022
by
Guilhem Saurel
Committed by
GitHub
Feb 28, 2022
Browse files
Merge pull request #7 from TLasguignes/master
Offices - last contribution
parents
a7450abf
780fafe3
Changes
2
Hide whitespace changes
Inline
Side-by-side
scripts/data/offices-ldap.json
View file @
96669b61
...
...
@@ -7,14 +7,6 @@
[
"Fourmy"
,
"Médéric"
],
[
"Nicolin"
,
"Alexis"
],
[
"Ramuzat"
,
"Noelie"
]
],
"B185"
:
[
...
...
@@ -99,8 +91,14 @@
"Côme"
],
[
"Romualdi"
,
"Giulio"
"Smaldone"
,
"Filippo Maria"
]
],
"B68"
:
[
[
"Deves"
,
"Mathieu"
]
],
"B69.1"
:
[
...
...
@@ -110,10 +108,6 @@
]
],
"B69.2"
:
[
[
"Ha"
,
"Thuc Long"
],
[
"Kleff"
,
"Sébastien"
...
...
@@ -140,9 +134,23 @@
"Lamiraux"
,
"Florent"
],
[
"Le"
,
"Quang Anh"
],
[
"Mansard"
,
"Nicolas"
]
],
"BSalleGerardBauzil"
:
[
[
"Depledt"
,
"Yann"
],
[
"Nguyen"
,
"Dinh Vinh Thanh"
]
]
}
\ No newline at end of file
scripts/offices.py
View file @
96669b61
...
...
@@ -84,18 +84,20 @@ class Offices:
# Stuff that is wrong in LDAP… We should fix that there
WRONG_OFFICE
=
{
'Exterieur'
:
{(
'Steve'
,
'Tonneau'
),
(
'Nils'
,
'Hareng'
)},
'Exterieur'
:
{(
'Nils'
,
'Hareng'
)},
'BSalleGerardBauzil'
:
{(
'Quang Anh'
,
'Le'
)},
'B69.1'
:
{(
'Guilhem'
,
'Saurel'
),
(
'Pierre'
,
'Fernbach'
)},
'B90'
:
{(
'Nicolas'
,
'Mansard'
)},
'B69.2'
:
{(
'D
. V.
Thanh'
,
'Nguyen'
)},
'B69.2'
:
{(
'D
inh Vinh
Thanh'
,
'Nguyen'
)
,
(
'Filip'
,
'Becanovic'
)
},
}
WRONG_OFFICE
=
{
k
:
{
Gepettist
(
sn
,
gn
)
for
(
gn
,
sn
)
in
v
}
for
k
,
v
in
WRONG_OFFICE
.
items
()}
# Fix unicode from LDAP data…
ALIAS
=
{
'B67'
:
({
Gepettist
(
'Leziart'
,
'Pierre-Alexandre'
)},
{
Gepettist
(
'Léziart'
,
'P-A'
)}),
'B61a'
:
({
Gepettist
(
'Taix'
,
'Michel'
)},
{
Gepettist
(
'Taïx'
,
'Michel'
)}),
'B91'
:
({
Gepettist
(
'Soueres'
,
'Philippe'
)},
{
Gepettist
(
'Souères'
,
'Philippe'
)}),
'B181'
:
({
Gepettist
(
'Ramuzat'
,
'Noelie'
)},
{
Gepettist
(
'Ramuzat'
,
'Noëlie'
)}),
'B67'
:
[({
Gepettist
(
'Leziart'
,
'Pierre-Alexandre'
)},
{
Gepettist
(
'Léziart'
,
'P-A'
)}),
({
Gepettist
(
'Smaldone'
,
'Filippo Maria'
)},
{
Gepettist
(
'Smaldone'
,
'Filippo M.'
)})],
'B61a'
:
[({
Gepettist
(
'Taix'
,
'Michel'
)},
{
Gepettist
(
'Taïx'
,
'Michel'
)})],
'B91'
:
[({
Gepettist
(
'Soueres'
,
'Philippe'
)},
{
Gepettist
(
'Souères'
,
'Philippe'
)})],
'B69.2'
:
[({
Gepettist
(
'Nguyen'
,
'Dinh Vinh Thanh'
)},
{
Gepettist
(
'Nguyen'
,
'D. V. T.'
)})],
}
...
...
@@ -143,8 +145,9 @@ def fix_wrong_offices(offices):
for
wrong_office
in
offices
:
if
wrong_office
!=
woffice
:
offices
[
wrong_office
]
-=
wmembers
# remove them from the other offices
for
office
,
(
before
,
after
)
in
ALIAS
.
items
():
offices
[
office
]
=
offices
[
office
]
-
before
|
after
for
office
,
aliases
in
ALIAS
.
items
():
for
before
,
after
in
aliases
:
offices
[
office
]
=
offices
[
office
]
-
before
|
after
return
offices
...
...
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