Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCODOC_R6A06
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Paul Milleville
SCODOC_R6A06
Commits
9c15cbe6
Commit
9c15cbe6
authored
1 year ago
by
Emmanuel Viennet
Browse files
Options
Downloads
Patches
Plain Diff
PE: Fix moys (thx @jmpulille). Ajoute log au zip.
parent
6761f5a6
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/pe/pe_affichage.py
+27
-8
27 additions, 8 deletions
app/pe/pe_affichage.py
app/pe/pe_jury.py
+14
-2
14 additions, 2 deletions
app/pe/pe_jury.py
app/pe/pe_view.py
+0
-8
0 additions, 8 deletions
app/pe/pe_view.py
with
41 additions
and
18 deletions
app/pe/pe_affichage.py
+
27
−
8
View file @
9c15cbe6
...
@@ -6,18 +6,37 @@
...
@@ -6,18 +6,37 @@
"""
Affichages, debug
"""
Affichages, debug
"""
"""
from
flask
import
g
from
app
import
log
from
app
import
log
PE_DEBUG
=
0
PE_DEBUG
=
False
if
not
PE_DEBUG
:
# log to notes.log
def
pe_print
(
*
a
,
**
kw
):
# kw is ignored. log always add a newline
log
(
"
"
.
join
(
a
))
# On stocke les logs PE dans g.scodoc_pe_log
# pour ne pas modifier les nombreux appels à pe_print.
def
pe_start_log
()
->
list
[
str
]:
"
Initialize log
"
g
.
scodoc_pe_log
=
[]
return
g
.
scodoc_pe_log
def
pe_print
(
*
a
):
"
Log (or print in PE_DEBUG mode) and store in g
"
lines
=
getattr
(
g
,
"
scodoc_pe_log
"
)
if
lines
is
None
:
lines
=
pe_start_log
()
msg
=
"
"
.
join
(
a
)
lines
.
append
(
msg
)
if
PE_DEBUG
:
print
(
msg
)
else
:
else
:
pe_print
=
print
# print function
log
(
msg
)
def
pe_get_log
()
->
str
:
"
Renvoie une chaîne avec tous les messages loggués
"
return
"
\n
"
.
join
(
getattr
(
g
,
"
scodoc_pe_log
"
,
[]))
# Affichage dans le tableur pe en cas d'absence de notes
# Affichage dans le tableur pe en cas d'absence de notes
SANS_NOTE
=
"
-
"
SANS_NOTE
=
"
-
"
...
...
This diff is collapsed.
Click to expand it.
app/pe/pe_jury.py
+
14
−
2
View file @
9c15cbe6
...
@@ -44,6 +44,7 @@ Created on Fri Sep 9 09:15:05 2016
...
@@ -44,6 +44,7 @@ Created on Fri Sep 9 09:15:05 2016
import
io
import
io
import
os
import
os
import
time
from
zipfile
import
ZipFile
from
zipfile
import
ZipFile
import
numpy
as
np
import
numpy
as
np
...
@@ -70,13 +71,17 @@ class JuryPE(object):
...
@@ -70,13 +71,17 @@ class JuryPE(object):
"""
"""
def
__init__
(
self
,
diplome
):
def
__init__
(
self
,
diplome
):
pe_affichage
.
pe_start_log
()
self
.
diplome
=
diplome
self
.
diplome
=
diplome
"
L
'
année du diplome
"
"
L
'
année du diplome
"
self
.
nom_export_zip
=
f
"
Jury_PE_
{
self
.
diplome
}
"
self
.
nom_export_zip
=
f
"
Jury_PE_
{
self
.
diplome
}
"
"
Nom du zip où ranger les fichiers générés
"
"
Nom du zip où ranger les fichiers générés
"
# Chargement des étudiants à prendre en compte Sydans le jury
pe_affichage
.
pe_print
(
f
"
Données de poursuite d
'
étude générées le
{
time
.
strftime
(
'
%d/%m/%Y à %H
:
%
M
'
)
}
\n
"
)
# Chargement des étudiants à prendre en compte dans le jury
pe_affichage
.
pe_print
(
pe_affichage
.
pe_print
(
f
"""
*** Recherche et chargement des étudiants diplômés en
{
f
"""
*** Recherche et chargement des étudiants diplômés en
{
self
.
diplome
}
"""
self
.
diplome
}
"""
...
@@ -96,6 +101,8 @@ class JuryPE(object):
...
@@ -96,6 +101,8 @@ class JuryPE(object):
self
.
_gen_xls_interclassements_rcss
(
zipfile
)
self
.
_gen_xls_interclassements_rcss
(
zipfile
)
self
.
_gen_xls_synthese_jury_par_tag
(
zipfile
)
self
.
_gen_xls_synthese_jury_par_tag
(
zipfile
)
self
.
_gen_xls_synthese_par_etudiant
(
zipfile
)
self
.
_gen_xls_synthese_par_etudiant
(
zipfile
)
# et le log
self
.
_add_log_to_zip
(
zipfile
)
# Fin !!!! Tada :)
# Fin !!!! Tada :)
...
@@ -251,6 +258,11 @@ class JuryPE(object):
...
@@ -251,6 +258,11 @@ class JuryPE(object):
zipfile
,
f
"
synthese_jury_
{
self
.
diplome
}
_par_etudiant.xlsx
"
,
output
.
read
()
zipfile
,
f
"
synthese_jury_
{
self
.
diplome
}
_par_etudiant.xlsx
"
,
output
.
read
()
)
)
def
_add_log_to_zip
(
self
,
zipfile
):
"""
Add a text file with the log messages
"""
log_data
=
pe_affichage
.
pe_get_log
()
self
.
add_file_to_zip
(
zipfile
,
"
pe_log.txt
"
,
log_data
)
def
add_file_to_zip
(
self
,
zipfile
:
ZipFile
,
filename
:
str
,
data
,
path
=
""
):
def
add_file_to_zip
(
self
,
zipfile
:
ZipFile
,
filename
:
str
,
data
,
path
=
""
):
"""
Add a file to given zip
"""
Add a file to given zip
All files under NOM_EXPORT_ZIP/
All files under NOM_EXPORT_ZIP/
...
@@ -397,7 +409,7 @@ class JuryPE(object):
...
@@ -397,7 +409,7 @@ class JuryPE(object):
# Les moys
# Les moys
champ
=
(
descr
,
NOM_STAT_GROUPE
,
"
moy
"
)
champ
=
(
descr
,
NOM_STAT_GROUPE
,
"
moy
"
)
moys
=
moy_traj
.
get_m
ax
()
moys
=
moy_traj
.
get_m
oy
()
donnees
.
loc
[
etudids_communs
,
champ
]
=
moys
.
loc
[
etudids_communs
]
donnees
.
loc
[
etudids_communs
,
champ
]
=
moys
.
loc
[
etudids_communs
]
# Ajoute les données d'interclassement
# Ajoute les données d'interclassement
...
...
This diff is collapsed.
Click to expand it.
app/pe/pe_view.py
+
0
−
8
View file @
9c15cbe6
...
@@ -102,11 +102,3 @@ def pe_view_sem_recap(formsemestre_id: int):
...
@@ -102,11 +102,3 @@ def pe_view_sem_recap(formsemestre_id: int):
download_name
=
scu
.
sanitize_filename
(
jury
.
nom_export_zip
+
"
.zip
"
),
download_name
=
scu
.
sanitize_filename
(
jury
.
nom_export_zip
+
"
.zip
"
),
as_attachment
=
True
,
as_attachment
=
True
,
)
)
return
render_template
(
"
pe/pe_view_sem_recap.j2
"
,
annee_diplome
=
annee_diplome
,
formsemestre
=
formsemestre
,
sco
=
ScoData
(
formsemestre
=
formsemestre
),
cosemestres
=
cosemestres
,
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment