Groupe de %(partition_name)s | " % p)
H.append(' | """)
- groups = sco_groups.get_etud_groups(context, etud["etudid"], sem)
+ groups = sco_groups.get_etud_groups(etud["etudid"], sem)
for partition in partitions:
if partition["partition_name"]:
gr_name = ""
@@ -214,7 +214,7 @@ def _make_menu(context, partitions, title="", check="true"):
for partition in partitions:
if partition["partition_name"] != None:
p_idx += 1
- for group in sco_groups.get_partition_groups(context, partition):
+ for group in sco_groups.get_partition_groups(partition):
items.append(
{
"title": "%s %s"
@@ -252,13 +252,13 @@ def moduleimpl_inscriptions_stats(context, formsemestre_id, REQUEST=None):
"""
authuser = REQUEST.AUTHENTICATED_USER
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
inscrits = sco_formsemestre_inscriptions.do_formsemestre_inscription_list(
- context, args={"formsemestre_id": formsemestre_id}
+ args={"formsemestre_id": formsemestre_id}
)
set_all = set([x["etudid"] for x in inscrits])
partitions, partitions_etud_groups = sco_groups.get_formsemestre_groups(
- context, formsemestre_id
+ formsemestre_id
)
can_change = authuser.has_permission(Permission.ScoEtudInscrit) and sem["etat"]
@@ -441,8 +441,8 @@ def descr_inscrs_module(
gr = [] # [ ( partition_name , [ group_names ] ) ]
for partition in partitions:
grp = [] # groupe de cette partition
- for group in sco_groups.get_partition_groups(context, partition):
- members = sco_groups.get_group_members(context, group["group_id"])
+ for group in sco_groups.get_partition_groups(partition):
+ members = sco_groups.get_group_members(group["group_id"])
set_g = set([m["etudid"] for m in members])
if set_g.issubset(set_m):
grp.append(group["group_name"])
@@ -492,7 +492,7 @@ def get_etuds_with_capitalized_ue(context, formsemestre_id):
UECaps = scu.DictDefault(defaultvalue=[])
nt = sco_cache.NotesTableCache.get(formsemestre_id) # > get_ues, get_etud_ue_status
inscrits = sco_formsemestre_inscriptions.do_formsemestre_inscription_list(
- context, args={"formsemestre_id": formsemestre_id}
+ args={"formsemestre_id": formsemestre_id}
)
ues = nt.get_ues()
for ue in ues:
@@ -569,7 +569,7 @@ def do_etud_inscrit_ue(context, etudid, formsemestre_id, ue_id, REQUEST=None):
"""Incrit l'etudiant de tous les modules de cette UE dans ce semestre."""
# Verifie qu'il est bien inscrit au semestre
insem = sco_formsemestre_inscriptions.do_formsemestre_inscription_list(
- context, args={"formsemestre_id": formsemestre_id, "etudid": etudid}
+ args={"formsemestre_id": formsemestre_id, "etudid": etudid}
)
if not insem:
raise ScoValueError("%s n'est pas inscrit au semestre !" % etudid)
diff --git a/app/scodoc/sco_moduleimpl_status.py b/app/scodoc/sco_moduleimpl_status.py
index dec6e461d..07888eeb4 100644
--- a/app/scodoc/sco_moduleimpl_status.py
+++ b/app/scodoc/sco_moduleimpl_status.py
@@ -161,10 +161,8 @@ def moduleimpl_status(context, moduleimpl_id=None, partition_id=None, REQUEST=No
M = sco_moduleimpl.do_moduleimpl_list(context, moduleimpl_id=moduleimpl_id)[0]
formsemestre_id = M["formsemestre_id"]
Mod = sco_edit_module.do_module_list(context, args={"module_id": M["module_id"]})[0]
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
- F = sco_formations.formation_list(
- context, args={"formation_id": sem["formation_id"]}
- )[0]
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
+ F = sco_formations.formation_list(args={"formation_id": sem["formation_id"]})[0]
ModInscrits = sco_moduleimpl.do_moduleimpl_inscription_list(
context, moduleimpl_id=M["moduleimpl_id"]
)
@@ -312,7 +310,7 @@ def moduleimpl_status(context, moduleimpl_id=None, partition_id=None, REQUEST=No
)
#
# Liste les noms de partitions
- partitions = sco_groups.get_partitions_list(context, sem["formsemestre_id"])
+ partitions = sco_groups.get_partitions_list(sem["formsemestre_id"])
H.append(
"""Afficher les groupes de """
)
diff --git a/app/scodoc/sco_news.py b/app/scodoc/sco_news.py
index 214b95fd6..28a6472bc 100644
--- a/app/scodoc/sco_news.py
+++ b/app/scodoc/sco_news.py
@@ -188,7 +188,7 @@ def _get_formsemestre_infos_from_news(context, n):
return {}
try:
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
except:
# semestre n'existe plus
return {}
diff --git a/app/scodoc/sco_page_etud.py b/app/scodoc/sco_page_etud.py
index e4319850a..6fbd806b6 100644
--- a/app/scodoc/sco_page_etud.py
+++ b/app/scodoc/sco_page_etud.py
@@ -209,7 +209,7 @@ def ficheEtud(context, etudid=None, REQUEST=None):
info["modifadresse"] = ""
# Groupes:
- sco_groups.etud_add_group_infos(context, info, info["cursem"])
+ sco_groups.etud_add_group_infos(info, info["cursem"])
# Parcours de l'étudiant
if info["sems"]:
@@ -228,7 +228,7 @@ def ficheEtud(context, etudid=None, REQUEST=None):
)
grlink = '%s' % descr["situation"]
else:
- group = sco_groups.get_etud_main_group(context, etudid, sem)
+ group = sco_groups.get_etud_main_group(etudid, sem)
if group["partition_name"]:
gr_name = group["group_name"]
else:
@@ -247,9 +247,7 @@ def ficheEtud(context, etudid=None, REQUEST=None):
sem_info[sem["formsemestre_id"]] = grlink
if info["sems"]:
- Se = sco_parcours_dut.SituationEtudParcours(
- context, etud, info["last_formsemestre_id"]
- )
+ Se = sco_parcours_dut.SituationEtudParcours(etud, info["last_formsemestre_id"])
info["liste_inscriptions"] = formsemestre_recap_parcours_table(
context,
Se,
@@ -571,11 +569,11 @@ def etud_info_html(context, etudid, with_photo="1", REQUEST=None, debug=False):
# Informations sur l'etudiant dans le semestre courant:
sem = None
if formsemestre_id: # un semestre est spécifié par la page
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
elif etud["cursem"]: # le semestre "en cours" pour l'étudiant
sem = etud["cursem"]
if sem:
- groups = sco_groups.get_etud_groups(context, etudid, sem)
+ groups = sco_groups.get_etud_groups(etudid, sem)
grc = sco_groups.listgroups_abbrev(groups)
H += 'En S%d: %s
' % (sem["semestre_id"], grc)
H += "" # fin partie gauche (eid_left)
diff --git a/app/scodoc/sco_parcours_dut.py b/app/scodoc/sco_parcours_dut.py
index c9ee7a4ae..6a8b0e5dd 100644
--- a/app/scodoc/sco_parcours_dut.py
+++ b/app/scodoc/sco_parcours_dut.py
@@ -105,7 +105,7 @@ class DecisionSem(object):
# log('%s: %s %s %s %s %s' % (self.codechoice,code_etat,new_code_prev,formsemestre_id_utilise_pour_compenser,devenir,assiduite) )
-def SituationEtudParcours(context, etud, formsemestre_id):
+def SituationEtudParcours(etud, formsemestre_id):
"""renvoie une instance de SituationEtudParcours (ou sous-classe spécialisée)"""
nt = sco_cache.NotesTableCache.get(
formsemestre_id
@@ -113,23 +113,23 @@ def SituationEtudParcours(context, etud, formsemestre_id):
parcours = nt.parcours
#
if parcours.ECTS_ONLY:
- return SituationEtudParcoursECTS(context, etud, formsemestre_id, nt)
+ return SituationEtudParcoursECTS(etud, formsemestre_id, nt)
else:
- return SituationEtudParcoursGeneric(context, etud, formsemestre_id, nt)
+ return SituationEtudParcoursGeneric(etud, formsemestre_id, nt)
class SituationEtudParcoursGeneric(object):
"Semestre dans un parcours"
- def __init__(self, context, etud, formsemestre_id, nt):
+ def __init__(self, etud, formsemestre_id, nt):
"""
etud: dict filled by fill_etuds_info()
"""
- self.context = context
+ self.context = None # #context
self.etud = etud
self.etudid = etud["etudid"]
self.formsemestre_id = formsemestre_id
- self.sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ self.sem = sco_formsemestre.get_formsemestre(formsemestre_id)
self.nt = nt
self.formation = self.nt.formation
self.parcours = self.nt.parcours
@@ -672,8 +672,8 @@ class SituationEtudParcoursGeneric(object):
class SituationEtudParcoursECTS(SituationEtudParcoursGeneric):
"""Gestion parcours basés sur ECTS"""
- def __init__(self, context, etud, formsemestre_id, nt):
- SituationEtudParcoursGeneric.__init__(self, context, etud, formsemestre_id, nt)
+ def __init__(self, etud, formsemestre_id, nt):
+ SituationEtudParcoursGeneric.__init__(self, etud, formsemestre_id, nt)
def could_be_compensated(self):
return False # jamais de compensations dans ce parcours
@@ -1098,10 +1098,8 @@ def list_formsemestre_utilisateurs_uecap(context, formsemestre_id):
(et qui doivent donc etre sortis du cache si l'on modifie ce
semestre): meme code formation, meme semestre_id, date posterieure"""
cnx = ndb.GetDBConnexion()
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
- F = sco_formations.formation_list(
- context, args={"formation_id": sem["formation_id"]}
- )[0]
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
+ F = sco_formations.formation_list(args={"formation_id": sem["formation_id"]})[0]
cursor = cnx.cursor(cursor_factory=ndb.ScoDocCursor)
cursor.execute(
"""SELECT sem.id
diff --git a/app/scodoc/sco_pdf.py b/app/scodoc/sco_pdf.py
index 2721f9192..5eaa40e64 100755
--- a/app/scodoc/sco_pdf.py
+++ b/app/scodoc/sco_pdf.py
@@ -166,7 +166,6 @@ class ScolarsPageTemplate(PageTemplate):
def __init__(
self,
document,
- context=None,
pagesbookmarks={},
author=None,
title=None,
@@ -304,7 +303,9 @@ def _makeTimeDict():
def pdf_basic_page(
- objects, title="", preferences=None, context=None
+ objects,
+ title="",
+ preferences=None,
): # used by gen_table.make_page()
"""Simple convenience fonction: build a page from a list of platypus objects,
adding a title if specified.
@@ -315,7 +316,6 @@ def pdf_basic_page(
document.addPageTemplates(
ScolarsPageTemplate(
document,
- context=context,
title=title,
author="%s %s (E. Viennet)" % (SCONAME, SCOVERSION),
footer_template="Edité par %(scodoc_name)s le %(day)s/%(month)s/%(year)s à %(hour)sh%(minute)s",
diff --git a/app/scodoc/sco_permissions_check.py b/app/scodoc/sco_permissions_check.py
index 2e5cd0d80..6fdfcf053 100644
--- a/app/scodoc/sco_permissions_check.py
+++ b/app/scodoc/sco_permissions_check.py
@@ -27,7 +27,7 @@ def can_edit_notes(authuser, moduleimpl_id, allow_ens=True):
context = None # XXX #context
uid = str(authuser)
M = sco_moduleimpl.do_moduleimpl_list(context, moduleimpl_id=moduleimpl_id)[0]
- sem = sco_formsemestre.get_formsemestre(context, M["formsemestre_id"])
+ sem = sco_formsemestre.get_formsemestre(M["formsemestre_id"])
if not sem["etat"]:
return False # semestre verrouillé
@@ -69,7 +69,7 @@ def can_edit_evaluation(moduleimpl_id=None):
raise ValueError("no moduleimpl specified") # bug
uid = current_user.user_name
M = sco_moduleimpl.do_moduleimpl_list(context, moduleimpl_id=moduleimpl_id)[0]
- sem = sco_formsemestre.get_formsemestre(context, M["formsemestre_id"])
+ sem = sco_formsemestre.get_formsemestre(M["formsemestre_id"])
if (
current_user.has_permission(Permission.ScoEditAllEvals)
@@ -110,7 +110,7 @@ def can_validate_sem(formsemestre_id):
from app.scodoc import sco_formsemestre
context = None # XXX #context
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
if not sem["etat"]:
return False # semestre verrouillé
@@ -122,7 +122,7 @@ def can_edit_pv(formsemestre_id):
from app.scodoc import sco_formsemestre
context = None # XXX #context
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
if is_chef_or_diretud(sem):
return True
# Autorise les secrétariats, repérés via la permission ScoEtudChangeAdr
@@ -148,7 +148,7 @@ def check_access_diretud(formsemestre_id, required_permission=Permission.ScoImpl
context = None # XXX #context
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
header = html_sco_header.sco_header(page_title="Accès interdit")
footer = html_sco_header.sco_footer()
if (
@@ -175,7 +175,7 @@ def can_change_groups(formsemestre_id):
from app.scodoc import sco_formsemestre
context = None # XXX #context
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
if not sem["etat"]:
return False # semestre verrouillé
if current_user.has_permission(Permission.ScoEtudChangeGroups):
diff --git a/app/scodoc/sco_placement.py b/app/scodoc/sco_placement.py
index d8f82befd..baa71f04b 100644
--- a/app/scodoc/sco_placement.py
+++ b/app/scodoc/sco_placement.py
@@ -56,7 +56,7 @@ from app.scodoc.sco_excel import *
from app.scodoc.TrivialFormulator import TrivialFormulator
-def do_placement_selectetuds(context, REQUEST):
+def do_placement_selectetuds(REQUEST):
"""
Choisi les étudiants et les infos sur la salle pour leur placement.
"""
@@ -67,9 +67,7 @@ def do_placement_selectetuds(context, REQUEST):
E = E[0]
# M = sco_moduleimpl.do_moduleimpl_list(context, moduleimpl_id=E["moduleimpl_id"])[0]
# groupes
- groups = sco_groups.do_evaluation_listegroupes(
- context, evaluation_id, include_default=True
- )
+ groups = sco_groups.do_evaluation_listegroupes(evaluation_id, include_default=True)
grlabs = [g["group_name"] or "tous" for g in groups] # legendes des boutons
grnams = [g["group_id"] for g in groups] # noms des checkbox
no_groups = (len(groups) == 1) and groups[0]["group_name"] is None
@@ -270,7 +268,7 @@ def do_placement(context, REQUEST):
# Construit liste des etudiants
group_ids = REQUEST.form.get("group_ids", [])
- groups = sco_groups.listgroups(context, group_ids)
+ groups = sco_groups.listgroups(group_ids)
gr_title_filename = sco_groups.listgroups_filename(groups)
# gr_title = sco_groups.listgroups_abbrev(groups)
@@ -287,7 +285,7 @@ def do_placement(context, REQUEST):
M = sco_moduleimpl.do_moduleimpl_list(context, moduleimpl_id=E["moduleimpl_id"])[0]
Mod = sco_edit_module.do_module_list(context, args={"module_id": M["module_id"]})[0]
- sem = sco_formsemestre.get_formsemestre(context, M["formsemestre_id"])
+ sem = sco_formsemestre.get_formsemestre(M["formsemestre_id"])
evalname = "%s-%s" % (Mod["code"], ndb.DateDMYtoISO(E["jour"]))
if E["description"]:
evaltitre = E["description"]
@@ -309,7 +307,7 @@ def do_placement(context, REQUEST):
] # XXX utiliser ZScolar (parent)
# infos inscription
inscr = sco_formsemestre_inscriptions.do_formsemestre_inscription_list(
- context, {"etudid": etudid, "formsemestre_id": M["formsemestre_id"]}
+ {"etudid": etudid, "formsemestre_id": M["formsemestre_id"]}
)[0]
if inscr["etat"] != "D":
nom = scu.strupper(ident["nom"])
@@ -419,7 +417,7 @@ def placement_eval_selectetuds(context, evaluation_id, REQUEST=None):
formid = "placementfile"
if not REQUEST.form.get("%s-submitted" % formid, False):
# not submitted, choix groupe
- r = do_placement_selectetuds(context, REQUEST)
+ r = do_placement_selectetuds(REQUEST)
if r:
H.append(r)
diff --git a/app/scodoc/sco_poursuite_dut.py b/app/scodoc/sco_poursuite_dut.py
index 065b03d8f..9ce7daff5 100644
--- a/app/scodoc/sco_poursuite_dut.py
+++ b/app/scodoc/sco_poursuite_dut.py
@@ -156,7 +156,7 @@ def _getEtudInfoGroupes(context, group_ids, etat=None):
"""
etuds = []
for group_id in group_ids:
- members = sco_groups.get_group_members(context, group_id, etat=etat)
+ members = sco_groups.get_group_members(group_id, etat=etat)
for m in members:
etud = sco_etud.get_etud_info(etudid=m["etudid"], filled=True)[0]
etuds.append(etud)
@@ -168,7 +168,7 @@ def formsemestre_poursuite_report(
context, formsemestre_id, format="html", REQUEST=None
):
"""Table avec informations "poursuite" """
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
etuds = _getEtudInfoGroupes(
context, [sco_groups.get_default_group(formsemestre_id)]
)
diff --git a/app/scodoc/sco_preferences.py b/app/scodoc/sco_preferences.py
index 5e5188469..9529fd982 100644
--- a/app/scodoc/sco_preferences.py
+++ b/app/scodoc/sco_preferences.py
@@ -2123,7 +2123,7 @@ class SemPreferences(object):
"sem_preferences.edit doit etre appele sur un semestre !"
) # a bug !
context = None # XXX TO REMOVE
- sem = sco_formsemestre.get_formsemestre(context, self.formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(self.formsemestre_id)
H = [
html_sco_header.html_sem_header(
context, REQUEST, "Préférences du semestre", sem
diff --git a/app/scodoc/sco_prepajury.py b/app/scodoc/sco_prepajury.py
index 8d79821a0..6a3e6a5f1 100644
--- a/app/scodoc/sco_prepajury.py
+++ b/app/scodoc/sco_prepajury.py
@@ -49,12 +49,12 @@ def feuille_preparation_jury(context, formsemestre_id, REQUEST):
formsemestre_id
) # > get_etudids, get_etud_moy_gen, get_ues, get_etud_ue_status, get_etud_decision_sem, identdict,
etudids = nt.get_etudids(sorted=True) # tri par moy gen
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
- etud_groups = sco_groups.formsemestre_get_etud_groupnames(context, formsemestre_id)
- main_partition_id = sco_groups.formsemestre_get_main_partition(
- context, formsemestre_id
- )["partition_id"]
+ etud_groups = sco_groups.formsemestre_get_etud_groupnames(formsemestre_id)
+ main_partition_id = sco_groups.formsemestre_get_main_partition(formsemestre_id)[
+ "partition_id"
+ ]
prev_moy_ue = scu.DictDefault(defaultvalue={}) # ue_code_s : { etudid : moy ue }
prev_ue_acro = {} # ue_code_s : acronyme (à afficher)
@@ -76,7 +76,7 @@ def feuille_preparation_jury(context, formsemestre_id, REQUEST):
if not info:
continue # should not occur...
etud = info[0]
- Se = sco_parcours_dut.SituationEtudParcours(context, etud, formsemestre_id)
+ Se = sco_parcours_dut.SituationEtudParcours(etud, formsemestre_id)
if Se.prev:
ntp = sco_cache.NotesTableCache.get(
Se.prev["formsemestre_id"]
diff --git a/app/scodoc/sco_pvjury.py b/app/scodoc/sco_pvjury.py
index e925c8f2a..e22ec7316 100644
--- a/app/scodoc/sco_pvjury.py
+++ b/app/scodoc/sco_pvjury.py
@@ -226,7 +226,7 @@ def dict_pvjury(
if not etudids:
return {}
cnx = ndb.GetDBConnexion()
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
max_date = "0000-01-01"
has_prev = False # vrai si au moins un etudiant a un code prev
semestre_non_terminal = False # True si au moins un etudiant a un devenir
@@ -235,7 +235,7 @@ def dict_pvjury(
D = {} # même chose que L, mais { etudid : dec }
for etudid in etudids:
etud = sco_etud.get_etud_info(etudid=etudid, filled=True)[0]
- Se = sco_parcours_dut.SituationEtudParcours(context, etud, formsemestre_id)
+ Se = sco_parcours_dut.SituationEtudParcours(etud, formsemestre_id)
semestre_non_terminal = semestre_non_terminal or Se.semestre_non_terminal
d = {}
d["identite"] = nt.identdict[etudid]
@@ -299,9 +299,7 @@ def dict_pvjury(
obs = []
for compensator in compensators:
# nb: il ne devrait y en avoir qu'un !
- csem = sco_formsemestre.get_formsemestre(
- context, compensator["formsemestre_id"]
- )
+ csem = sco_formsemestre.get_formsemestre(compensator["formsemestre_id"])
obs.append(
"%s compensé par %s (%s)"
% (sem["sem_id_txt"], csem["sem_id_txt"], csem["anneescolaire"])
@@ -309,7 +307,7 @@ def dict_pvjury(
if d["decision_sem"] and d["decision_sem"]["compense_formsemestre_id"]:
compensed = sco_formsemestre.get_formsemestre(
- context, d["decision_sem"]["compense_formsemestre_id"]
+ d["decision_sem"]["compense_formsemestre_id"]
)
obs.append(
"%s compense %s (%s)"
@@ -362,7 +360,7 @@ def dict_pvjury(
"has_prev": has_prev,
"semestre_non_terminal": semestre_non_terminal,
"formation": sco_formations.formation_list(
- context, args={"formation_id": sem["formation_id"]}
+ args={"formation_id": sem["formation_id"]}
)[0],
"decisions": L,
"decisions_dict": D,
@@ -619,9 +617,9 @@ def formsemestre_pvjury_pdf(
"""Generation PV jury en PDF: saisie des paramètres
Si etudid, PV pour un seul etudiant. Sinon, tout les inscrits au groupe indiqué.
"""
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
# Mise à jour des groupes d'étapes:
- sco_groups.create_etapes_partition(context, formsemestre_id)
+ sco_groups.create_etapes_partition(formsemestre_id)
groups_infos = None
if etudid:
# PV pour ce seul étudiant:
@@ -719,7 +717,7 @@ def formsemestre_pvjury_pdf(
)
finally:
PDFLOCK.release()
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
dt = time.strftime("%Y-%m-%d")
if groups_infos:
groups_filename = "-" + groups_infos.groups_filename
@@ -731,7 +729,7 @@ def formsemestre_pvjury_pdf(
def descrform_pvjury(context, sem):
"""Définition de formulaire pour PV jury PDF"""
- F = sco_formations.formation_list(context, formation_id=sem["formation_id"])[0]
+ F = sco_formations.formation_list(formation_id=sem["formation_id"])[0]
return [
(
"date_commission",
@@ -816,7 +814,7 @@ def formsemestre_lettres_individuelles(
context, formsemestre_id, group_ids=[], REQUEST=None
):
"Lettres avis jury en PDF"
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
if not group_ids:
# tous les inscrits du semestre
group_ids = [sco_groups.get_default_group(formsemestre_id)]
@@ -887,7 +885,7 @@ def formsemestre_lettres_individuelles(
formsemestre_id
)
)
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
dt = time.strftime("%Y-%m-%d")
groups_filename = "-" + groups_infos.groups_filename
filename = "lettres-%s%s-%s.pdf" % (sem["titre_num"], groups_filename, dt)
diff --git a/app/scodoc/sco_pvpdf.py b/app/scodoc/sco_pvpdf.py
index 2f101cf67..e4be4aabb 100644
--- a/app/scodoc/sco_pvpdf.py
+++ b/app/scodoc/sco_pvpdf.py
@@ -348,7 +348,7 @@ def pdf_lettres_individuelles(
etuds = [x["identite"] for x in dpv["decisions"]]
sco_etud.fill_etuds_info(etuds)
#
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
prefs = sco_preferences.SemPreferences(formsemestre_id)
params = {
"date_jury": date_jury,
diff --git a/app/scodoc/sco_recapcomplet.py b/app/scodoc/sco_recapcomplet.py
index 6f27c6cff..9b7bd5cbc 100644
--- a/app/scodoc/sco_recapcomplet.py
+++ b/app/scodoc/sco_recapcomplet.py
@@ -73,10 +73,8 @@ def formsemestre_recapcomplet(
pour tous les étudiants, les moyennes par UE et générale,
trié par moyenne générale décroissante.
"""
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
- F = sco_formations.formation_list(
- context, args={"formation_id": sem["formation_id"]}
- )[0]
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
+ F = sco_formations.formation_list(args={"formation_id": sem["formation_id"]})[0]
parcours = sco_codes_parcours.get_parcours_from_code(F["type_parcours"])
# traduit du DTML
modejury = int(modejury)
@@ -276,7 +274,7 @@ def make_formsemestre_recapcomplet(
]
sem = sco_formsemestre.do_formsemestre_list(
- context, args={"formsemestre_id": formsemestre_id}
+ args={"formsemestre_id": formsemestre_id}
)[0]
nt = sco_cache.NotesTableCache.get(
formsemestre_id
@@ -285,15 +283,15 @@ def make_formsemestre_recapcomplet(
ues = nt.get_ues() # incluant le(s) UE de sport
#
partitions, partitions_etud_groups = sco_groups.get_formsemestre_groups(
- context, formsemestre_id
+ formsemestre_id
)
if rank_partition_id and format == "html":
# Calcul rang sur une partition et non sur l'ensemble
# seulement en format HTML (car colonnes rangs toujours presentes en xls)
- rank_partition = sco_groups.get_partition(context, rank_partition_id)
+ rank_partition = sco_groups.get_partition(rank_partition_id)
rank_label = "Rg (%s)" % rank_partition["partition_name"]
else:
- rank_partition = sco_groups.get_default_partition(context, formsemestre_id)
+ rank_partition = sco_groups.get_default_partition(formsemestre_id)
rank_label = "Rg"
T = nt.get_table_moyennes_triees()
@@ -380,7 +378,7 @@ def make_formsemestre_recapcomplet(
gr_name = "Déf."
is_dem[etudid] = False
else:
- group = sco_groups.get_etud_main_group(context, etudid, sem)
+ group = sco_groups.get_etud_main_group(etudid, sem)
gr_name = group["group_name"] or ""
is_dem[etudid] = False
if rank_partition_id:
@@ -951,9 +949,7 @@ def formsemestres_bulletins(context, annee_scolaire, REQUEST=None):
:returns: JSON
"""
jslist = []
- sems = sco_formsemestre.list_formsemestre_by_etape(
- context, annee_scolaire=annee_scolaire
- )
+ sems = sco_formsemestre.list_formsemestre_by_etape(annee_scolaire=annee_scolaire)
log("formsemestres_bulletins(%s): %d sems" % (annee_scolaire, len(sems)))
for sem in sems:
J, _, _ = _formsemestre_recapcomplet_json(
diff --git a/app/scodoc/sco_report.py b/app/scodoc/sco_report.py
index 8dfd60bcb..96f62ade9 100644
--- a/app/scodoc/sco_report.py
+++ b/app/scodoc/sco_report.py
@@ -223,7 +223,7 @@ def formsemestre_report(
"""
Tableau sur résultats (result) par type de category bac
"""
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
if not category_name:
category_name = category
if not result_name:
@@ -258,7 +258,7 @@ def formsemestre_report(
# """
# Tableau sur résultats par type de bac
# """
-# sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+# sem = sco_formsemestre.get_formsemestre( formsemestre_id)
# title = 'Statistiques bacs ' + sem['titreannee']
# etuds = formsemestre_etuds_stats(context, sem)
# tab = formsemestre_report(context, formsemestre_id, etuds, REQUEST=REQUEST,
@@ -284,7 +284,7 @@ def formsemestre_report_counts(
"""
Tableau comptage avec choix des categories
"""
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
category_name = scu.strcapitalize(category)
title = "Comptages " + category_name
etuds = formsemestre_etuds_stats(context, sem, only_primo=only_primo)
@@ -405,7 +405,7 @@ def table_suivi_cohorte(
"""
sem = sco_formsemestre.get_formsemestre(
- context, formsemestre_id
+ formsemestre_id
) # sem est le semestre origine
t0 = time.time()
@@ -465,7 +465,7 @@ def table_suivi_cohorte(
sem["members"] = orig_set
for s in sems:
ins = sco_formsemestre_inscriptions.do_formsemestre_inscription_list(
- context, args={"formsemestre_id": s["formsemestre_id"]}
+ args={"formsemestre_id": s["formsemestre_id"]}
) # sans dems
inset = set([i["etudid"] for i in ins])
s["members"] = orig_set.intersection(inset)
@@ -727,7 +727,7 @@ def formsemestre_suivi_cohorte(
)
if only_primo:
tab.base_url += "&only_primo=on"
- t = tab.make_page(context, format=format, with_html_headers=False, REQUEST=REQUEST)
+ t = tab.make_page(format=format, with_html_headers=False, REQUEST=REQUEST)
if format != "html":
return t
@@ -1033,7 +1033,7 @@ def tsp_etud_list(
ramene aussi ensembles des bacs, genres, statuts de (tous) les etudiants
"""
# log('tsp_etud_list(%s, bac="%s")' % (formsemestre_id,bac))
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
nt = sco_cache.NotesTableCache.get(formsemestre_id) # > get_etudids,
etudids = nt.get_etudids()
etuds = []
@@ -1088,7 +1088,7 @@ def table_suivi_parcours(
context, formsemestre_id, only_primo=False, grouped_parcours=True
):
"""Tableau recapitulant tous les parcours"""
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
etuds, bacs, bacspecialites, annee_bacs, civilites, statuts = tsp_etud_list(
context, formsemestre_id, only_primo=only_primo
)
@@ -1221,7 +1221,7 @@ def formsemestre_suivi_parcours(
tab.base_url += "&only_primo=1"
if no_grouping:
tab.base_url += "&no_grouping=1"
- t = tab.make_page(context, format=format, with_html_headers=False, REQUEST=REQUEST)
+ t = tab.make_page(format=format, with_html_headers=False, REQUEST=REQUEST)
if format != "html":
return t
F = [
@@ -1484,7 +1484,7 @@ def formsemestre_graph_parcours(
):
"""Graphe suivi cohortes"""
# log("formsemestre_graph_parcours")
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
if format == "pdf":
(
doc,
diff --git a/app/scodoc/sco_saisie_notes.py b/app/scodoc/sco_saisie_notes.py
index 9d1b44d11..fde9107db 100644
--- a/app/scodoc/sco_saisie_notes.py
+++ b/app/scodoc/sco_saisie_notes.py
@@ -763,7 +763,7 @@ def feuille_saisie_notes(context, evaluation_id, group_ids=[], REQUEST=None):
M = sco_moduleimpl.do_moduleimpl_list(context, moduleimpl_id=E["moduleimpl_id"])[0]
formsemestre_id = M["formsemestre_id"]
Mod = sco_edit_module.do_module_list(context, args={"module_id": M["module_id"]})[0]
- sem = sco_formsemestre.get_formsemestre(context, M["formsemestre_id"])
+ sem = sco_formsemestre.get_formsemestre(M["formsemestre_id"])
mod_responsable = sco_users.user_info(M["responsable_id"])
if E["jour"]:
indication_date = ndb.DateDMYtoISO(E["jour"])
@@ -790,7 +790,7 @@ def feuille_saisie_notes(context, evaluation_id, group_ids=[], REQUEST=None):
etat=None,
REQUEST=REQUEST,
)
- groups = sco_groups.listgroups(context, groups_infos.group_ids)
+ groups = sco_groups.listgroups(groups_infos.group_ids)
gr_title_filename = sco_groups.listgroups_filename(groups)
# gr_title = sco_groups.listgroups_abbrev(groups)
if None in [g["group_name"] for g in groups]: # tous les etudiants
@@ -809,7 +809,7 @@ def feuille_saisie_notes(context, evaluation_id, group_ids=[], REQUEST=None):
etuds = _get_sorted_etuds(context, E, etudids, formsemestre_id)
for e in etuds:
etudid = e["etudid"]
- groups = sco_groups.get_etud_groups(context, etudid, sem)
+ groups = sco_groups.get_etud_groups(etudid, sem)
grc = sco_groups.listgroups_abbrev(groups)
L.append(
@@ -972,7 +972,7 @@ def saisie_notes(context, evaluation_id, group_ids=[], REQUEST=None):
def _get_sorted_etuds(context, E, etudids, formsemestre_id):
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
NotesDB = sco_evaluations.do_evaluation_get_all_notes(
E["evaluation_id"]
) # Notes existantes
@@ -985,10 +985,10 @@ def _get_sorted_etuds(context, E, etudids, formsemestre_id):
etuds.append(e)
# infos inscription dans ce semestre
e["inscr"] = sco_formsemestre_inscriptions.do_formsemestre_inscription_list(
- context, {"etudid": etudid, "formsemestre_id": formsemestre_id}
+ {"etudid": etudid, "formsemestre_id": formsemestre_id}
)[0]
# Groupes auxquels appartient cet étudiant:
- e["groups"] = sco_groups.get_etud_groups(context, etudid, sem)
+ e["groups"] = sco_groups.get_etud_groups(etudid, sem)
# Information sur absence (tenant compte de la demi-journée)
jour_iso = ndb.DateDMYtoISO(E["jour"])
diff --git a/app/scodoc/sco_semset.py b/app/scodoc/sco_semset.py
index cc22bc01d..3e7e2402a 100644
--- a/app/scodoc/sco_semset.py
+++ b/app/scodoc/sco_semset.py
@@ -232,7 +232,6 @@ class SemSet(dict):
sem
for sem in sems
if sco_formsemestre.sem_in_semestre_scolaire(
- self.context,
sem,
year=self["annee_scolaire"],
saison=self["sem_id"],
@@ -403,7 +402,7 @@ def do_semset_add_sem(context, semset_id, formsemestre_id, REQUEST=None):
raise ScoValueError("empty semset_id")
s = SemSet(context, semset_id=semset_id)
# check for valid formsemestre_id
- _ = sco_formsemestre.get_formsemestre(context, formsemestre_id) # raise exc
+ _ = sco_formsemestre.get_formsemestre(formsemestre_id) # raise exc
s.add(formsemestre_id)
@@ -474,7 +473,7 @@ def semset_page(context, format="html", REQUEST=None):
preferences=sco_preferences.SemPreferences(),
)
if format != "html":
- return tab.make_page(context, format=format, REQUEST=REQUEST)
+ return tab.make_page(format=format, REQUEST=REQUEST)
page_title = "Ensembles de semestres"
H = [
diff --git a/app/scodoc/sco_synchro_etuds.py b/app/scodoc/sco_synchro_etuds.py
index 7a3db217d..52a5f8c09 100644
--- a/app/scodoc/sco_synchro_etuds.py
+++ b/app/scodoc/sco_synchro_etuds.py
@@ -90,7 +90,7 @@ def formsemestre_synchro_etuds(
que l'on va importer/inscrire
"""
log("formsemestre_synchro_etuds: formsemestre_id=%s" % formsemestre_id)
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
sem["etape_apo_str"] = sco_formsemestre.formsemestre_etape_apo_str(sem)
# Write access ?
authuser = REQUEST.AUTHENTICATED_USER
@@ -252,7 +252,7 @@ def formsemestre_synchro_etuds(
)
#
partitions = sco_groups.get_partitions_list(
- context, formsemestre_id, with_default=False
+ formsemestre_id, with_default=False
)
if partitions: # il y a au moins une vraie partition
H.append(
@@ -782,9 +782,9 @@ def formsemestre_import_etud_admission(
de chaque étudiant depuis le portail.
N'affecte pas les etudiants inconnus sur le portail.
"""
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
ins = sco_formsemestre_inscriptions.do_formsemestre_inscription_list(
- context, {"formsemestre_id": formsemestre_id}
+ {"formsemestre_id": formsemestre_id}
)
log(
"formsemestre_import_etud_admission: %s (%d etuds)"
diff --git a/app/scodoc/sco_trombino.py b/app/scodoc/sco_trombino.py
index 2b59fab11..f4d7ce970 100644
--- a/app/scodoc/sco_trombino.py
+++ b/app/scodoc/sco_trombino.py
@@ -385,7 +385,6 @@ def _trombino_pdf(context, groups_infos, REQUEST):
document.addPageTemplates(
sco_pdf.ScolarsPageTemplate(
document,
- context=context,
preferences=sco_preferences.SemPreferences(sem["formsemestre_id"]),
)
)
@@ -462,7 +461,6 @@ def _listeappel_photos_pdf(context, groups_infos, REQUEST):
document.addPageTemplates(
sco_pdf.ScolarsPageTemplate(
document,
- context,
preferences=sco_preferences.SemPreferences(sem["formsemestre_id"]),
)
)
diff --git a/app/scodoc/sco_trombino_tours.py b/app/scodoc/sco_trombino_tours.py
index 5905ff181..7d8a62796 100644
--- a/app/scodoc/sco_trombino_tours.py
+++ b/app/scodoc/sco_trombino_tours.py
@@ -141,7 +141,7 @@ def pdf_trombino_tours(
for group_id in groups_infos.group_ids:
if group_id != "None":
members, group, group_tit, sem, nbdem = sco_groups.get_group_infos(
- context, group_id, "I"
+ group_id, "I"
)
groups += " %s" % group_tit
L = []
@@ -179,9 +179,7 @@ def pdf_trombino_tours(
img = sco_trombino._get_etud_platypus_image(
context, m, image_width=PHOTOWIDTH
)
- etud_main_group = sco_groups.get_etud_main_group(
- context, m["etudid"], sem
- )
+ etud_main_group = sco_groups.get_etud_main_group(m["etudid"], sem)
if group_id != etud_main_group["group_id"]:
text_group = " (" + etud_main_group["group_name"] + ")"
else:
@@ -271,7 +269,6 @@ def pdf_trombino_tours(
document.addPageTemplates(
ScolarsPageTemplate(
document,
- context=context,
preferences=sco_preferences.SemPreferences(),
)
)
@@ -391,7 +388,7 @@ def pdf_feuille_releve_absences(
for group_id in groups_infos.group_ids:
members, group, group_tit, sem, nbdem = sco_groups.get_group_infos(
- context, group_id, "I"
+ group_id, "I"
)
L = []
@@ -467,7 +464,6 @@ def pdf_feuille_releve_absences(
document.addPageTemplates(
ScolarsPageTemplate(
document,
- context=context,
preferences=sco_preferences.SemPreferences(),
)
)
diff --git a/app/scodoc/sco_ue_external.py b/app/scodoc/sco_ue_external.py
index bb0e55287..24392997e 100644
--- a/app/scodoc/sco_ue_external.py
+++ b/app/scodoc/sco_ue_external.py
@@ -86,7 +86,7 @@ def external_ue_create(
):
"""Crée UE/matiere/module/evaluation puis saisie les notes"""
log("external_ue_create( formsemestre_id=%s, titre=%s )" % (formsemestre_id, titre))
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
# Contrôle d'accès:
if not current_user.has_permission(Permission.ScoImplement):
if not sem["resp_can_edit"] or (current_user.id not in sem["responsables"]):
@@ -219,7 +219,7 @@ def external_ue_create_form(context, formsemestre_id, etudid, REQUEST=None):
Note: pour l'édition éventuelle de ces informations, on utilisera les
fonctions standards sur les UE/modules/notes
"""
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
# Contrôle d'accès:
if not current_user.has_permission(Permission.ScoImplement):
if not sem["resp_can_edit"] or (current_user.id not in sem["responsables"]):
@@ -246,9 +246,7 @@ def external_ue_create_form(context, formsemestre_id, etudid, REQUEST=None):
""",
]
html_footer = html_sco_header.sco_footer()
- Fo = sco_formations.formation_list(
- context, args={"formation_id": sem["formation_id"]}
- )[0]
+ Fo = sco_formations.formation_list(args={"formation_id": sem["formation_id"]})[0]
parcours = sco_codes_parcours.get_parcours_from_code(Fo["type_parcours"])
ue_types = parcours.ALLOWED_UE_TYPES
ue_types.sort()
diff --git a/app/scodoc/sco_undo_notes.py b/app/scodoc/sco_undo_notes.py
index 427be6909..40327c2be 100644
--- a/app/scodoc/sco_undo_notes.py
+++ b/app/scodoc/sco_undo_notes.py
@@ -167,7 +167,7 @@ def evaluation_list_operations(context, REQUEST, evaluation_id):
% (E["description"], E["jour"]),
preferences=sco_preferences.SemPreferences(M["formsemestre_id"]),
)
- return tab.make_page(context, REQUEST=REQUEST)
+ return tab.make_page(REQUEST=REQUEST)
def formsemestre_list_saisies_notes(
@@ -176,7 +176,7 @@ def formsemestre_list_saisies_notes(
"""Table listant toutes les opérations de saisies de notes, dans toutes
les évaluations du semestre.
"""
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
r = ndb.SimpleDictFetch(
"""SELECT i.nom, n.*, mod.titre, e.description, e.jour
FROM notes_notes n, notes_evaluation e, notes_moduleimpl mi,
@@ -222,7 +222,7 @@ def formsemestre_list_saisies_notes(
base_url="%s?formsemestre_id=%s" % (REQUEST.URL0, formsemestre_id),
origin="Généré par %s le " % VERSION.SCONAME + scu.timedate_human_repr() + "",
)
- return tab.make_page(context, format=format, REQUEST=REQUEST)
+ return tab.make_page(format=format, REQUEST=REQUEST)
def get_note_history(context, evaluation_id, etudid, REQUEST=None, fmt=""):
diff --git a/app/views/absences.py b/app/views/absences.py
index d6f628d77..c0e6caf54 100644
--- a/app/views/absences.py
+++ b/app/views/absences.py
@@ -134,7 +134,7 @@ def _toboolean(x):
def index_html(context, REQUEST=None):
"""Gestionnaire absences, page principale"""
# crude portage from 1999 DTML
- sems = sco_formsemestre.do_formsemestre_list(context)
+ sems = sco_formsemestre.do_formsemestre_list()
authuser = REQUEST.AUTHENTICATED_USER
H = [
@@ -194,7 +194,7 @@ def cal_select_week(context, year=None):
"display calendar allowing week selection"
if not year:
year = scu.AnneeScolaire()
- sems = sco_formsemestre.do_formsemestre_list(context)
+ sems = sco_formsemestre.do_formsemestre_list()
if not sems:
js = ""
else:
@@ -364,9 +364,7 @@ def SignaleAbsenceGrHebdo(
# Si aucun etudiant n'est inscrit au module choisi...
moduleimpl_id = None
nt = sco_cache.NotesTableCache.get(formsemestre_id)
- sem = sco_formsemestre.do_formsemestre_list(
- context, {"formsemestre_id": formsemestre_id}
- )[0]
+ sem = sco_formsemestre.do_formsemestre_list({"formsemestre_id": formsemestre_id})[0]
# calcule dates jours de cette semaine
# liste de dates iso "yyyy-mm-dd"
@@ -535,7 +533,7 @@ def SignaleAbsenceGrSemestre(
if etuds:
nt = sco_cache.NotesTableCache.get(formsemestre_id)
sem = sco_formsemestre.do_formsemestre_list(
- context, {"formsemestre_id": formsemestre_id}
+ {"formsemestre_id": formsemestre_id}
)[0]
work_saturday = sco_abs.is_work_saturday(context)
jourdebut = sco_abs.ddmmyyyy(datedebut, work_saturday=work_saturday)
@@ -986,7 +984,7 @@ ou entrez une date pour visualiser les absents un jour donné :
"""
% (REQUEST.URL0, formsemestre_id, groups_infos.get_form_elem()),
)
- return tab.make_page(context, format=format, REQUEST=REQUEST)
+ return tab.make_page(format=format, REQUEST=REQUEST)
@bp.route("/EtatAbsencesDate")
@@ -1129,7 +1127,7 @@ def AddBilletAbsence(
billets = sco_abs.billet_absence_list(cnx, {"billet_id": billet_id})
tab = _tableBillets(context, billets, etud=etud)
log("AddBilletAbsence: new billet_id=%s (%gs)" % (billet_id, time.time() - t0))
- return tab.make_page(context, REQUEST=REQUEST, format="xml")
+ return tab.make_page(REQUEST=REQUEST, format="xml")
else:
return billet_id
@@ -1261,7 +1259,7 @@ def listeBilletsEtud(context, etudid=False, REQUEST=None, format="html"):
cnx = ndb.GetDBConnexion()
billets = sco_abs.billet_absence_list(cnx, {"etudid": etud["etudid"]})
tab = _tableBillets(context, billets, etud=etud)
- return tab.make_page(context, REQUEST=REQUEST, format=format)
+ return tab.make_page(REQUEST=REQUEST, format=format)
@bp.route("/XMLgetBilletsEtud")
diff --git a/app/views/entreprises.py b/app/views/entreprises.py
index 89cae38ca..cce8a5516 100644
--- a/app/views/entreprises.py
+++ b/app/views/entreprises.py
@@ -236,7 +236,7 @@ def index_html(
preferences=context.get_preferences(),
)
if format != "html":
- return tab.make_page(context, format=format, REQUEST=REQUEST)
+ return tab.make_page( format=format, REQUEST=REQUEST)
else:
H = [
entreprise_header(context, REQUEST=REQUEST, page_title="Suivi entreprises"),
@@ -311,7 +311,7 @@ def entreprise_contact_list(context, entreprise_id=None, format="html", REQUEST=
preferences=context.get_preferences(),
)
if format != "html":
- return tab.make_page(context, format=format, REQUEST=REQUEST)
+ return tab.make_page( format=format, REQUEST=REQUEST)
H.append(tab.html())
@@ -422,7 +422,7 @@ def entreprise_correspondant_list(
preferences=context.get_preferences(),
)
if format != "html":
- return tab.make_page(context, format=format, REQUEST=REQUEST)
+ return tab.make_page( format=format, REQUEST=REQUEST)
H.append(tab.html())
diff --git a/app/views/notes.py b/app/views/notes.py
index 915917735..d0b12bfe8 100644
--- a/app/views/notes.py
+++ b/app/views/notes.py
@@ -441,7 +441,7 @@ def formation_list(context, format=None, REQUEST=None, formation_id=None, args={
"""List formation(s) with given id, or matching args
(when args is given, formation_id is ignored).
"""
- r = sco_formations.formation_list(context, formation_id=formation_id, args=args)
+ r = sco_formations.formation_list(formation_id=formation_id, args=args)
return scu.sendResult(REQUEST, r, name="formation", format=format)
@@ -557,9 +557,7 @@ sco_publish(
@scodoc7func(context)
def formation_count_sems(context, formation_id):
"Number of formsemestre in this formation (locked or not)"
- sems = sco_formsemestre.do_formsemestre_list(
- context, args={"formation_id": formation_id}
- )
+ sems = sco_formsemestre.do_formsemestre_list(args={"formation_id": formation_id})
return len(sems)
@@ -606,7 +604,7 @@ def formsemestre_list(
for argname in ("formsemestre_id", "formation_id", "etape_apo"):
if L[argname] is not None:
args[argname] = L[argname]
- sems = sco_formsemestre.do_formsemestre_list(context, args=args)
+ sems = sco_formsemestre.do_formsemestre_list(args=args)
# log('formsemestre_list: format="%s", %s semestres found' % (format,len(sems)))
return scu.sendResult(REQUEST, sems, name="formsemestre", format=format)
@@ -628,7 +626,7 @@ def XMLgetFormsemestres(context, etape_apo=None, formsemestre_id=None, REQUEST=N
if REQUEST:
REQUEST.RESPONSE.setHeader("content-type", scu.XML_MIMETYPE)
doc = ElementTree.Element("formsemestrelist")
- for sem in sco_formsemestre.do_formsemestre_list(context, args=args):
+ for sem in sco_formsemestre.do_formsemestre_list(args=args):
doc.append("formsemestre", **sem)
return sco_xml.XML_HEADER + ElementTree.tostring(doc).decode(scu.SCO_ENCODING)
@@ -974,7 +972,7 @@ def view_module_abs(context, REQUEST, moduleimpl_id, format="html"):
M = sco_moduleimpl.do_moduleimpl_withmodule_list(
context, moduleimpl_id=moduleimpl_id
)[0]
- sem = sco_formsemestre.get_formsemestre(context, M["formsemestre_id"])
+ sem = sco_formsemestre.get_formsemestre(M["formsemestre_id"])
debut_sem = ndb.DateDMYtoISO(sem["date_debut"])
fin_sem = ndb.DateDMYtoISO(sem["date_fin"])
list_insc = sco_moduleimpl.do_moduleimpl_listeetuds(context, moduleimpl_id)
@@ -1041,7 +1039,7 @@ def view_module_abs(context, REQUEST, moduleimpl_id, format="html"):
)
if format != "html":
- return tab.make_page(context, format=format, REQUEST=REQUEST)
+ return tab.make_page(format=format, REQUEST=REQUEST)
return "\n".join(H) + tab.html() + html_sco_header.sco_footer()
@@ -1129,7 +1127,7 @@ def formsemestre_enseignants_list(context, REQUEST, formsemestre_id, format="htm
"""Liste les enseignants intervenants dans le semestre (resp. modules et chargés de TD)
et indique les absences saisies par chacun.
"""
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
# resp. de modules:
mods = sco_moduleimpl.do_moduleimpl_withmodule_list(
context, formsemestre_id=formsemestre_id
@@ -1274,7 +1272,7 @@ def do_formsemestre_inscription_listinscrits(
):
"""Liste les inscrits (état I) à ce semestre et cache le résultat"""
r = sco_formsemestre_inscriptions.do_formsemestre_inscription_listinscrits(
- context, formsemestre_id
+ formsemestre_id
)
return scu.sendResult(REQUEST, r, format=format, name="inscrits")
@@ -1291,7 +1289,7 @@ def formsemestre_desinscription(
S'il s'agit d'un semestre extérieur et qu'il n'y a plus d'inscrit,
le semestre sera supprimé.
"""
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
# -- check lock
if not sem["etat"]:
raise ScoValueError("desinscription impossible: semestre verrouille")
@@ -1332,7 +1330,7 @@ def formsemestre_desinscription(
sem["date_fin"],
)
inscrits = sco_formsemestre_inscriptions.do_formsemestre_inscription_list(
- context, args={"formsemestre_id": formsemestre_id}
+ args={"formsemestre_id": formsemestre_id}
)
nbinscrits = len(inscrits)
if nbinscrits <= 1:
@@ -1722,7 +1720,7 @@ def formsemestre_bulletins_choice(
context, REQUEST, formsemestre_id, title="", explanation="", choose_mail=False
):
"""Choix d'une version de bulletin"""
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
H = [
html_sco_header.html_sem_header(context, REQUEST, title, sem),
"""
@@ -1841,7 +1839,7 @@ def appreciation_add_form(
edit = 1
else:
edit = 0
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
# check custom access permission
can_edit_app = (current_user.id in sem["responsables"]) or (
current_user.has_permission(Permission.ScoEtudInscrit)
@@ -2144,7 +2142,7 @@ def formsemestre_validation_suppress_etud(
dest_url=scu.ScoURL(),
)
if not dialog_confirmed:
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
etud = sco_etud.get_etud_info(etudid=etudid, filled=1)[0]
nt = sco_cache.NotesTableCache.get(formsemestre_id) # > get_etud_decision_sem
decision_jury = nt.get_etud_decision_sem(etudid)
@@ -2378,7 +2376,7 @@ def check_sem_integrity(context, formsemestre_id, REQUEST, fix=False):
"""Debug.
Check that ue and module formations are consistents
"""
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
modimpls = sco_moduleimpl.do_moduleimpl_list(
context, formsemestre_id=formsemestre_id
@@ -2427,7 +2425,7 @@ def check_sem_integrity(context, formsemestre_id, REQUEST, fix=False):
formation_id = formations_set.pop()
if sem["formation_id"] != formation_id:
sem["formation_id"] = formation_id
- sco_formsemestre.do_formsemestre_edit(context, sem)
+ sco_formsemestre.do_formsemestre_edit(sem)
H.append("""Problème réparé: vérifiez
""")
else:
H.append(
@@ -2541,12 +2539,10 @@ def check_formsemestre_integrity(context, formsemestre_id, REQUEST=None):
def check_integrity_all(context, REQUEST=None):
"debug: verifie tous les semestres et tt les formations"
# formations
- for F in sco_formations.formation_list(
- context,
- ):
+ for F in sco_formations.formation_list():
check_form_integrity(context, F["formation_id"], REQUEST=REQUEST)
# semestres
- for sem in sco_formsemestre.do_formsemestre_list(context):
+ for sem in sco_formsemestre.do_formsemestre_list():
check_formsemestre_integrity(context, sem["formsemestre_id"], REQUEST=REQUEST)
return (
html_sco_header.sco_header()
diff --git a/app/views/scolar.py b/app/views/scolar.py
index a0969c67c..557819131 100644
--- a/app/views/scolar.py
+++ b/app/views/scolar.py
@@ -185,7 +185,7 @@ def edit_preferences(context, REQUEST):
def formsemestre_edit_preferences(context, formsemestre_id, REQUEST):
"""Edit preferences for a semestre"""
authuser = REQUEST.AUTHENTICATED_USER
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
ok = (
authuser.has_permission(Permission.ScoImplement)
or ((str(authuser) in sem["responsables"]) and sem["resp_can_edit"])
@@ -249,7 +249,7 @@ def showEtudLog(context, etudid, format="html", REQUEST=None):
preferences=sco_preferences.SemPreferences(),
)
- return tab.make_page(context, format=format, REQUEST=REQUEST)
+ return tab.make_page(format=format, REQUEST=REQUEST)
# ---------- PAGE ACCUEIL (listes) --------------
@@ -403,7 +403,7 @@ def etud_info(context, etudid=None, format="xml", REQUEST=None):
sem = etud["cursem"]
if sem:
- sco_groups.etud_add_group_infos(context, etud, sem)
+ sco_groups.etud_add_group_infos(etud, sem)
d["insemestre"] = [
{
"current": "1",
@@ -736,7 +736,7 @@ sco_publish(
# default=False,
# numero=None,
# redirect=1):
-# return sco_groups.partition_create(context, formsemestre_id,
+# return sco_groups.partition_create( formsemestre_id,
sco_publish("/etud_info_html", sco_page_etud.etud_info_html, Permission.ScoView)
@@ -893,7 +893,7 @@ def _formDem_of_Def(
):
"Formulaire démission ou défaillance Etudiant"
etud = sco_etud.get_etud_info(etudid=etudid, filled=1, REQUEST=REQUEST)[0]
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
if not sem["etat"]:
raise ScoValueError("Modification impossible: semestre verrouille")
@@ -980,12 +980,12 @@ def _do_dem_or_def_etud(
# un "evenement" scolarite
cnx = ndb.GetDBConnexion()
# check lock
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
if not sem["etat"]:
raise ScoValueError("Modification impossible: semestre verrouille")
#
ins = sco_formsemestre_inscriptions.do_formsemestre_inscription_list(
- context, {"etudid": etudid, "formsemestre_id": formsemestre_id}
+ {"etudid": etudid, "formsemestre_id": formsemestre_id}
)[0]
if not ins:
raise ScoException("etudiant non inscrit ?!")
@@ -1070,7 +1070,7 @@ def _do_cancel_dem_or_def(
):
"Annule une demission ou une défaillance"
# check lock
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
if not sem["etat"]:
raise ScoValueError("Modification impossible: semestre verrouille")
# verif
@@ -1095,7 +1095,7 @@ def _do_cancel_dem_or_def(
)
#
ins = sco_formsemestre_inscriptions.do_formsemestre_inscription_list(
- context, {"etudid": etudid, "formsemestre_id": formsemestre_id}
+ {"etudid": etudid, "formsemestre_id": formsemestre_id}
)[0]
if ins["etat"] != etat_current:
raise ScoException("etudiant non %s !!!" % etat_current) # obviously a bug
@@ -1620,7 +1620,7 @@ def check_group_apogee(
XXX A re-écrire pour API 2: prendre liste dans l'étape et vérifier à partir de cela.
"""
etat = etat or None
- members, group, _, sem, _ = sco_groups.get_group_infos(context, group_id, etat=etat)
+ members, group, _, sem, _ = sco_groups.get_group_infos(group_id, etat=etat)
formsemestre_id = group["formsemestre_id"]
cnx = ndb.GetDBConnexion()
@@ -1766,7 +1766,7 @@ def check_group_apogee(
def form_students_import_excel(context, REQUEST, formsemestre_id=None):
"formulaire import xls"
if formsemestre_id:
- sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
+ sem = sco_formsemestre.get_formsemestre(formsemestre_id)
dest_url = (
# scu.ScoURL() + "/formsemestre_status?formsemestre_id=%s" % formsemestre_id # TODO: Remplacer par for_url ?
url_for(
@@ -1929,7 +1929,7 @@ def import_generate_excel_sample(context, REQUEST, with_codesemestre="1"):
@scodoc7func(context)
def import_generate_admission_sample(context, REQUEST, formsemestre_id):
"une feuille excel pour importation données admissions"
- group = sco_groups.get_group(context, sco_groups.get_default_group(formsemestre_id))
+ group = sco_groups.get_group(sco_groups.get_default_group(formsemestre_id))
fmt = sco_import_etuds.sco_import_format()
data = sco_import_etuds.sco_import_generate_excel_sample(
fmt,
@@ -2110,7 +2110,7 @@ def stat_bac(context, formsemestre_id):
"Renvoie statistisques sur nb d'etudiants par bac"
cnx = ndb.GetDBConnexion()
ins = sco_formsemestre_inscriptions.do_formsemestre_inscription_list(
- context, args={"formsemestre_id": formsemestre_id}
+ args={"formsemestre_id": formsemestre_id}
)
Bacs = {} # type bac : nb etud
for i in ins:
diff --git a/refactor.py b/refactor.py
deleted file mode 100755
index 81f4cf168..000000000
--- a/refactor.py
+++ /dev/null
@@ -1,191 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: UTF-8 -*
-
-
-"""Outil pour migration ScoDoc 7 => ScoDoc 8
-
- - Liste des appels de la forme context.xxx
-./refactor.py showcontextcalls app/scodoc/*.p
-
- - remplace context.xxx par module.xxx
-
-./refactor.py refactor module.method app/scodoc/*.py
-
-
-
-Pour chaque module dans views:
- - construire la liste des fonctions définies dans ce module:
- get_module_functions
-
-Pour chaque module dans views et dans scodoc:
- - remplacer context.xxx par app.views.M.xxx
- où M est le module de views définissant xxx
- Si xxx n'est pas trouvé, erreur !
-"""
-
-
-from __future__ import print_function
-import re
-from pprint import pprint as pp
-import os
-import sys
-import types
-import tempfile
-import shutil
-import click
-
-TYPES_TO_SCAN = {
- types.FunctionType,
- # types.ClassType,
- # types.DictionaryType,
- # types.FloatType,
- # types.IntType,
- # types.ListType,
- # types.StringType,
- # types.TupleType,
-}
-
-
-def get_module_symbols(module):
- """returns list of symbols (functions and constants) defined in the given module"""
- return [
- f.__name__
- for f in [getattr(module, name) for name in dir(module)]
- if (type(f) in TYPES_TO_SCAN)
- and ((type(f) != types.FunctionType) or (f.__module__ == module.__name__))
- ]
-
-
-# print("\n".join(f.__name__ for f in get_module_functions(notes)))
-
-
-def scan_views_symbols():
- """Scan modules in app.views and returns
- { }
- """
- import app
-
- views_modules = [
- getattr(app.views, mod_name)
- for mod_name in dir(app.views)
- if type(getattr(app.views, mod_name)) == types.ModuleType
- ]
- sym2mod = {} # symbole_name : module
- for module in views_modules:
- start = "app.views."
- assert module.__name__.startswith(start)
- module_name = module.__name__[len(start) :]
- symbols = set(get_module_symbols(module))
- print("%d symbols defined in %s" % (len(symbols), module))
- dups = symbols.intersection(sym2mod)
- if len(dups):
- print("duplicated symbols !")
- for dup in dups:
- print("%s:\t%s\t%s" % (dup, sym2mod[dup], module_name))
-
- sym2mod.update({s: module_name for s in symbols})
- return sym2mod
-
-
-def replace_context_calls(sourcefilename, sym2mod):
- undefined_list = [] # noms de fonctions non présents dans les modules "views"
-
- def repl(m):
- funcname = m.group(1)
- module = sym2mod.get(funcname, False)
- if module:
- return module + "." + funcname
- else:
- undefined_list.append((sourcefilename, funcname))
- return m.group(0) # leave unchanged
-
- print("reading %s" % sourcefilename)
- source = open(sourcefilename).read()
- exp = re.compile(r"context\.([a-zA-Z0-9_]+)")
- source2 = exp.sub(repl, source)
- return source2, undefined_list
-
-
-# sym2mod = scan_views_symbols()
-
-# source2, undefined_list = replace_context_calls("app/scodoc/sco_core.py", sym2mod)
-
-
-def list_context_calls(sourcefilename):
- """List of methods called on context in this file"""
- source = open(sourcefilename).read()
- exp = re.compile(r"context\.([a-zA-Z0-9_]+)")
- return sorted(set(exp.findall(source)))
-
-
-def get_context_calls(src_filenames):
- """returns { method_name : [ list of module names in which it is called ] }"""
- S = {}
- for sourcefilename in src_filenames:
- l = list_context_calls(sourcefilename)
- module_name = os.path.splitext(os.path.split(sourcefilename)[1])[0]
- for m in l:
- if m in S:
- S[m].append(module_name)
- else:
- S[m] = [module_name]
- return S
-
-
-@click.group()
-def cli():
- pass
-
-
-@cli.command()
-@click.argument("src_filenames", nargs=-1)
-def showcontextcalls(src_filenames):
- click.echo("Appels de méthodes sur l'object context")
- S = get_context_calls(src_filenames)
- #
- for method in sorted(S.keys()):
- print(method + ":\t" + ", ".join(S[method]))
-
-
-@cli.command()
-@click.argument("modulemethod", nargs=1)
-@click.argument("src_filenames", nargs=-1)
-def refactor(modulemethod, src_filenames):
- """Replace call context.method(...)
- by module.method(context, ...)
- in all given source filenames
- """
- modulemethod = str(modulemethod) # avoid unicode in Python2
- frags = modulemethod.split(".")
- if len(frags) < 2:
- raise click.BadParameter("must be module.method", param_hint="modulemethod")
- module = ".".join(frags[:-1])
- method = frags[-1]
- backup = tempfile.mkdtemp(dir="/tmp")
- for sourcefilename in src_filenames:
- source_module_name = os.path.splitext(os.path.split(sourcefilename)[1])[0]
- is_local = source_module_name == module
- source = open(sourcefilename).read()
- if not is_local:
- source2 = source.replace(
- "context." + method + "(", module + "." + method + "(context, "
- )
- source2 = source2.replace(
- "context.Notes." + method + "(", module + "." + method + "(context, "
- )
- else:
- # call in the same module:
- source2 = source.replace("context." + method + "(", method + "(context, ")
- if source2 != source:
- print("changed %s" % sourcefilename)
- shutil.move(sourcefilename, backup)
- open(sourcefilename, "w").write(source2)
- print("Done.\noriginal files saved in %s\n" % backup)
-
-
-if __name__ == "__main__":
- try:
- cli(obj={})
- except SystemExit as e:
- if e.code != 0:
- raise
diff --git a/scotests/test_groupes.py b/scotests/test_groupes.py
index 62c59a861..ff7813409 100644
--- a/scotests/test_groupes.py
+++ b/scotests/test_groupes.py
@@ -292,12 +292,8 @@ for etud in etuds[10:]:
# --- Liste des groupes présents aux évaluation
-lig1 = sco_groups.do_evaluation_listegroupes(
- context.Scolarite, e1["evaluation_id"], include_default=False
-)
-lig2 = sco_groups.do_evaluation_listegroupes(
- context.Scolarite, e2["evaluation_id"], include_default=False
-)
+lig1 = sco_groups.do_evaluation_listegroupes(e1["evaluation_id"], include_default=False)
+lig2 = sco_groups.do_evaluation_listegroupes(e2["evaluation_id"], include_default=False)
assert len(lig1) == 2
diff --git a/scotests/test_jurype.py b/scotests/test_jurype.py
index 99f1c649d..3f3cd4583 100644
--- a/scotests/test_jurype.py
+++ b/scotests/test_jurype.py
@@ -73,7 +73,7 @@ modele = "un_avis.tex" # Modele à actualiser au regard des résultats de l'ét
# Calcul du Jury PE
# *****************************************************************************
# semsDUT = [sem for sem in sems if 1 <= sem['semestre_id'] <= 4 ]
-semBase = sco_formsemestre.get_formsemestre(context, fid)
+semBase = sco_formsemestre.get_formsemestre(fid)
jury = pe_jurype.JuryPE(context, semBase)
diff --git a/tests/unit/sco_fake_gen.py b/tests/unit/sco_fake_gen.py
index 9cf9276e4..e7d7fd895 100644
--- a/tests/unit/sco_fake_gen.py
+++ b/tests/unit/sco_fake_gen.py
@@ -154,7 +154,7 @@ class ScoFake(object):
if not acronyme:
acronyme = "TEST" + str(random.randint(100000, 999999))
oid = sco_edit_formation.do_formation_create(context, locals())
- oids = sco_formations.formation_list(context, formation_id=oid)
+ oids = sco_formations.formation_list(formation_id=oid)
if not oids:
raise ScoValueError("formation not created !")
return oids[0]
@@ -241,7 +241,7 @@ class ScoFake(object):
responsables = (self.default_user.id,)
oid = sco_formsemestre.do_formsemestre_create(locals())
oids = sco_formsemestre.do_formsemestre_list(
- context, args={"formsemestre_id": oid}
+ args={"formsemestre_id": oid}
) # API inconsistency
if not oids:
raise ScoValueError("formsemestre not created !")
diff --git a/tests/unit/test_abs_demijournee.py b/tests/unit/test_abs_demijournee.py
index fded74de3..0fd3bae0f 100644
--- a/tests/unit/test_abs_demijournee.py
+++ b/tests/unit/test_abs_demijournee.py
@@ -280,18 +280,17 @@ def test_abs_basic(test_client):
# --- Création d'un groupe
_ = sco_groups.partition_create(
- context,
formsemestre_id=sem["formsemestre_id"],
partition_name="Eleve",
)
- li1 = sco_groups.get_partitions_list(context, sem["formsemestre_id"])
- _ = sco_groups.createGroup(context, li1[0]["partition_id"], "Groupe 1")
+ li1 = sco_groups.get_partitions_list(sem["formsemestre_id"])
+ _ = sco_groups.createGroup(li1[0]["partition_id"], "Groupe 1")
# --- Affectation des élèves dans des groupes
- li_grp1 = sco_groups.get_partition_groups(context, li1[0])
+ li_grp1 = sco_groups.get_partition_groups(li1[0])
for etud in etuds:
- sco_groups.set_group(context, etud["etudid"], li_grp1[0]["group_id"])
+ sco_groups.set_group(etud["etudid"], li_grp1[0]["group_id"])
# --- Test de EtatAbsencesGroupes
diff --git a/tests/unit/test_caches.py b/tests/unit/test_caches.py
index d6ecb0bf9..e2aaa1a19 100644
--- a/tests/unit/test_caches.py
+++ b/tests/unit/test_caches.py
@@ -31,7 +31,7 @@ def test_notes_table(test_client):
# prépare le département avec quelques semestres:
run_sco_basic()
#
- sems = sco_formsemestre.do_formsemestre_list(context)
+ sems = sco_formsemestre.do_formsemestre_list()
assert len(sems)
sem = sems[0]
formsemestre_id = sem["formsemestre_id"]