diff options
author | Alban Gruin | 2019-08-30 12:27:00 +0200 |
---|---|---|
committer | Alban Gruin | 2019-08-30 13:56:33 +0200 |
commit | a235752368c6eff21400f6f8089ee3bf781cf36e (patch) | |
tree | 1ae11ca7f3351838a424f9e45509831468c1d471 /management/parsers/ups2018.py | |
parent | 797a8a7b57b91823ee4b306ca91256dad4e3f504 (diff) |
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 <alban at pa1ch dot fr>
Diffstat (limited to 'management/parsers/ups2018.py')
-rw-r--r-- | management/parsers/ups2018.py | 10 |
1 files changed, 5 insertions, 5 deletions
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] |