Skip to content

Commit

Permalink
Remove outdated CAS (#255)
Browse files Browse the repository at this point in the history
* Delete cas without educonnect

* Delete deleted auth type

* delete deleted imports in ents.py

* delete oze

* delete oze in init

* delete outdated ent in doc

* add ac_reims in docs

* sync imports with ent.py init.py

* sync doc ent with imports ent.py

* rangement par ordre alphabétique ent.rst

* rajout ents encore fonctionnels ent.py

* resyncronisation init.py

* resyncronisation doc ent.rst

* replace ozecollege_yvelines by ent_ecollege78

* add ent_ecollege78 to imports

* add doc for ent_ecollege78

* black

* Réimport ac rennes init

* Redéclaration ac rennes et reims dans ent.rst

* tentative de fix oze

* tentative de fix ent creuse

* fix failing tests

---------

Co-authored-by: Baptiste D <63651713+Bapt5@users.noreply.github.com>
  • Loading branch information
LeGeek01 and Bapt5 authored Sep 5, 2023
1 parent bd82793 commit 2299247
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 90 deletions.
41 changes: 12 additions & 29 deletions docs/source/api/ent.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
.. _ent:

ENT / CAS
=========

All ENT functions that you can use while initialising the client.
All ENT functions that you can use while initializing the client.

An example of client initialisation with the ac_reunion ENT:
An example of client initialization with the ac_reunion ENT:

.. code-block:: python
Expand All @@ -23,61 +21,42 @@ An example of client initialisation with the ac_reunion ENT:

-----------------------------------------------------------------


.. currentmodule:: pronotepy.ent

.. autofunction:: ac_clermont_ferrand

.. autofunction:: ac_grenoble

.. autofunction:: ac_lyon

.. autofunction:: ac_orleans_tours

.. autofunction:: ac_poitiers

.. autofunction:: ac_reunion

.. autofunction:: ac_reims

.. autofunction:: ac_rennes

.. autofunction:: ac_reunion

.. autofunction:: atrium_sud

.. autofunction:: cas_agora06

.. autofunction:: cas_arsene76

.. autofunction:: cas_arsene76_edu

.. autofunction:: cas_cybercolleges42

.. autofunction:: cas_cybercolleges42_edu

.. autofunction:: cas_ent27

.. autofunction:: cas_kosmos

.. autofunction:: cas_seinesaintdenis_edu

.. autofunction:: eclat_bfc

.. autofunction:: ecollege_haute_garonne

.. autofunction:: ecollege_haute_garonne_edu

.. autofunction:: enc_hauts_de_seine

.. autofunction:: ent2d_bordeaux

.. autofunction:: ent77

.. autofunction:: ent_94

.. autofunction:: ent_auvergnerhonealpe

.. autofunction:: ent_creuse

.. autofunction:: ent_creuse_educonnect

.. autofunction:: ent_elyco

.. autofunction:: ent_essonne
Expand All @@ -90,16 +69,20 @@ An example of client initialisation with the ac_reunion ENT:

.. autofunction:: ent_var

.. autofunction:: ent77

.. autofunction:: ent_ecollege78

.. autofunction:: extranet_colleges_somme

.. autofunction:: ile_de_france

.. autofunction:: l_normandie

.. autofunction:: laclasse_educonnect

.. autofunction:: laclasse_lyon

.. autofunction:: l_normandie

.. autofunction:: lyceeconnecte_aquitaine

.. autofunction:: lyceeconnecte_edu
Expand Down
62 changes: 29 additions & 33 deletions pronotepy/ent/__init__.py
Original file line number Diff line number Diff line change
@@ -1,50 +1,46 @@
from .ent import (
ac_clermont_ferrand,
ac_grenoble,
ac_lyon,
cas_arsene76,
cas_ent27,
cas_kosmos,
ent_creuse,
ent_creuse_educonnect,
occitanie_toulouse,
occitanie_montpellier,
val_doise,
cas_cybercolleges42_edu,
ecollege_haute_garonne_edu,
ac_orleans_tours,
ac_poitiers,
ac_reims,
ac_reunion,
atrium_sud,
cas_agora06,
cas_arsene76,
cas_arsene76_edu,
cas_cybercolleges42,
cas_cybercolleges42_edu,
cas_ent27,
cas_kosmos,
cas_seinesaintdenis_edu,
cas_arsene76_edu,
eclat_bfc,
ecollege_haute_garonne,
ecollege_haute_garonne_edu,
enc_hauts_de_seine,
ent2d_bordeaux,
ent77,
ent_94,
ent_auvergnerhonealpe,
ent_creuse,
ent_elyco,
laclasse_educonnect,
monbureaunumerique,
ac_reims,
occitanie_montpellier_educonnect,
occitanie_toulouse_edu,
ent77,
ent_ecollege78,
ent_essonne,
ent_hdf,
ent_mayotte,
ile_de_france,
neoconnect_guadeloupe,
paris_classe_numerique,
lyceeconnecte_aquitaine,
ent_94,
ent_hdf,
ent_somme,
ent_var,
ile_de_france,
l_normandie,
laclasse_educonnect,
laclasse_lyon,
lyceeconnecte_aquitaine,
lyceeconnecte_edu,
monbureaunumerique,
neoconnect_guadeloupe,
occitanie_montpellier,
occitanie_montpellier_educonnect,
occitanie_toulouse,
occitanie_toulouse_edu,
ozecollege_yvelines,
paris_classe_numerique,
val_doise,
ent_elyco,
ent2d_bordeaux,
# enc_hauts_de_seine,
atrium_sud,
laclasse_lyon,
extranet_colleges_somme,
)
from .complex_ent import ac_rennes, pronote_hubeduconnect
38 changes: 11 additions & 27 deletions pronotepy/ent/ent.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,19 @@

"""CAS"""

ac_clermont_ferrand = partial(
_cas,
url="https://cas.ent.auvergnerhonealpes.fr/login?selection=CLERMONT-ATS_parent_eleve",
)

ac_grenoble = partial(
_cas,
url="https://cas.ent.auvergnerhonealpes.fr/login?selection=GRE-ATS_parent_eleve",
)

ac_lyon = partial(
_cas,
url="https://cas.ent.auvergnerhonealpes.fr/login?selection=LYON-ATS_parent_eleve",
)

cas_arsene76 = partial(
_cas, url="https://cas.arsene76.fr/login?selection=ATS_parent_eleve"
)

cas_cybercolleges42 = partial(
_cas, url="https://cas.cybercolleges42.fr/login?selection=ATS_parent_eleve"
)
) # à supprimer aux vacances d'automne

cas_ent27 = partial(_cas, url="https://cas.ent27.fr/login?selection=ATS_parent_eleve")
# à supprimer aux vacances d'automne

cas_kosmos = partial(_cas, url="https://cas.kosmoseducation.com/login")

ecollege_haute_garonne = partial(
_cas, url="https://cas.ecollege.haute-garonne.fr/login?selection=ATS_parent_eleve"
ent_creuse = partial(
_cas, url="https://cas.entcreuse.fr/login?selection=ATS_parent_eleve"
)

ent_creuse = partial(_cas, url="https://cas.entcreuse.fr/login")

occitanie_toulouse = partial(
_cas, url="https://cas.mon-ent-occitanie.fr/login?selection=TOULO-ENT_parent_eleve"
)
Expand Down Expand Up @@ -134,10 +114,16 @@
url="https://cas.mon-ent-occitanie.fr/login?selection=TOULO-EDU_parent_eleve&service=https://example.com/",
)

ent_creuse_educonnect = partial(
_cas_edu, url="https://cas.entcreuse.fr/login?selection=EDU"
)

"""Open ENT NG"""

ent77 = partial(_open_ent_ng, url="https://ent77.seine-et-marne.fr/auth/login")

ent_ecollege78 = partial(_open_ent_ng, url="https://ent.ecollege78.fr/auth/login")

ent_essonne = partial(
_open_ent_ng, url="https://www.moncollege-ent.essonne.fr/auth/login"
)
Expand Down Expand Up @@ -195,9 +181,7 @@

"""OZE ENT"""

enc_hauts_de_seine = partial(_oze_ent, url="https://enc.hauts-de-seine.fr/")

ozecollege_yvelines = partial(_oze_ent, url="https://ozecollege.yvelines.fr/")
# enc_hauts_de_seine = partial(_oze_ent, url="https://enc.hauts-de-seine.fr/")

"""Simple Auth"""

Expand Down
2 changes: 1 addition & 1 deletion pronotepy/ent/generic_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def _oze_ent(
username = f"{username}@{domain}"

soup = BeautifulSoup(response.text, "html.parser")
form = soup.find("form", {"id": "auth_form"})
form = soup.find("form", {"id": "kc-form-login"})
payload = {}
for input_ in form.findAll("input"):
payload[input_["name"]] = input_.get("value")
Expand Down

0 comments on commit 2299247

Please sign in to comment.