[scodoc-devel] [SVN] Scolar : [1806] amelioration detection ancien codage bacs

eviennet at lipn.univ-paris13.fr eviennet at lipn.univ-paris13.fr
Dim 7 Oct 18:21:31 CEST 2018


Une pièce jointe HTML a été nettoyée...
URL: https://listes.univ-paris13.fr/pipermail/scodoc-devel/attachments/20181007/197d16c0/attachment.htm 
-------------- section suivante --------------
Modified: branches/ScoDoc7/sco_bac.py
===================================================================
--- branches/ScoDoc7/sco_bac.py	2018-10-07 15:44:18 UTC (rev 1805)
+++ branches/ScoDoc7/sco_bac.py	2018-10-07 16:21:31 UTC (rev 1806)
@@ -109,6 +109,10 @@
     (t[0], t[1]) : t[2:] for t in _BACS 
 }
 
+# bac :  (abbrev, type) (retient la derniere)
+BACS_S = {
+    t[0] : t[2:] for t in _BACS 
+}
 
 class Baccalaureat:
     def __init__(self, bac, specialite=''):
@@ -119,6 +123,12 @@
         if self._type is None and specialite and specialite.startswith(bac):
             specialite = specialite[len(bac):].strip(' -')
             self._abbrev, self._type = BACS_SSP.get( (bac, specialite), (None, None))
+        # Cherche la forme serie specialite
+        if self._type is None and specialite:
+            self._abbrev, self._type = BACS_S.get(bac + ' ' + specialite, (None, None))
+        # Cherche avec juste le bac, sans specialite
+        if self._type is None:
+            self._abbrev, self._type = BACS_S.get(bac, (None, None))
     
     def abbrev(self):
         "abbreviation for this bac"


Plus d'informations sur la liste de diffusion scodoc-devel