From a235752368c6eff21400f6f8089ee3bf781cf36e Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Fri, 30 Aug 2019 12:27:00 +0200 Subject: ups2018: déplacement des préfixes de cours dans une constante Le parseur UPS2018 va se servir de cette liste aussi, elle est donc déplacée dans sa propre constante. Signed-off-by: Alban Gruin --- management/parsers/ups2018.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'management/parsers') diff --git a/management/parsers/ups2018.py b/management/parsers/ups2018.py index afbfc4b..0d6d798 100644 --- a/management/parsers/ups2018.py +++ b/management/parsers/ups2018.py @@ -32,6 +32,10 @@ from .abstractparser import AbstractParser, ParserError VARNAME = "v.events.list = " +GROUP_PREFIXES = ("L1 ", "L2 ", "L3 ", "L3P ", "M1 ", "M2 ", "DEUST ", "MAG1 ", + "1ERE ANNEE ", "2EME ANNEE ", "3EME ANNEE ", + "MAT-Agreg Interne ") + def find_events_list(soup): res = [] @@ -123,11 +127,7 @@ class Parser(AbstractParser): min_i = 1 i = min_i - while i < len(data) and not data[i].startswith( - ("L1 ", "L2 ", "L3 ", "L3P ", "M1 ", "M2 ", "DEUST ", "MAG1 ", - "1ERE ANNEE ", "2EME ANNEE ", "3EME ANNEE ", - "MAT-Agreg Interne ") - ): + while i < len(data) and not data[i].startswith(GROUP_PREFIXES): i += 1 groups = data[i] -- cgit v1.2.1