Commit e431a83a authored by Vincent-Xavier JUMEL's avatar Vincent-Xavier JUMEL
Browse files

Ajout des fichiers nécessaires


Signed-off-by: default avatarVincent-Xavier JUMEL <vincent-xavier.jumel@lasallesaintdenis.com>
parent 28e1bda3
Pipeline #291415 failed with stages
in 7 minutes and 52 seconds
import csv
import requests
import json
import datetime
import sys
from base64 import urlsafe_b64encode as b64encode
def connect(username, password):
auth = {"identifiant": username, "motdepasse": password}
r = requests.post(
'https://apip.ecoledirecte.com/v3/login.awp',
data = f'data={json.dumps(auth)}'
)
return json.loads(r.text)['token']
def get_edt(token, date):
date_next_day = datetime.datetime.strftime((datetime.datetime.fromisoformat(date) + datetime.timedelta(days=1)),'%Y-%m-%d')
data = f'data={{"token":"{token}"}}'
r = requests.post(
f'https://apip.ecoledirecte.com/v3/cahierdetexte/loadslots/{date}/{date}.awp?verbe=get',
data=data
)
return json.loads(r.text)['data']
def get_classe_seance(token, date, classe):
for cours in get_edt(token, date):
if cours['entityCode'] == classe:
return cours
def put_seance(token, date, classe, contenu):
seance_info = get_classe_seance(token, date, classe)
seance_info['token'] = token
if 'seance' not in seance_info.keys():
seance_info['seance'] = dict()
seance_info['seance']['modeEdit'] = "True"
seance_info['seance']['contenu'] = b64encode(bytes(contenu,'utf-8')).decode('utf-8')
data = f'data={json.dumps(seance_info)}'
r = requests.post(
f'https://apip.ecoledirecte.com/v3/cahierdetexte/seance/{classe}/{seance_info["matiereCode"]}/{date}.awp?verbe=put',
data=data
)
return r
if __name__ == '__main__':
username, password= tuple(sys.argv[1:])
token = connect(username, password)
with open('compile.csv','r') as fp:
fichiers = csv.DictReader(fp, delimiter=';')
for seance in fichiers:
put_seance(token, seance['dates'], seance['classe'], seance['message'])
import csv
import subprocess
import requests
with open('compile.csv','r') as fp:
fichiers = csv.DictReader(fp, delimiter=';')
for seance in fichiers:
documents = seance['fichiers'].split(' ')
for document in documents:
subprocess.run(['latexmk','-pdf',document])
#!/bin/sh
# Copyright 2015 Brent Longborough
# Part of gitinfo2 package Version 2
# Release 2.0.7 2015-11-22
# Please read gitinfo2.pdf for licencing and other details
# -----------------------------------------------------
# Post-{commit,checkout,merge} hook for the gitinfo2 package
#
# Get the first tag found in the history from the current HEAD
FIRSTTAG=$(git describe --tags --always --dirty='-*' 2>/dev/null)
# Get the first tag in history that looks like a Release
RELTAG=$(git describe --tags --long --always --dirty='-*' --match '[0-9]*.*' 2>/dev/null)
# Hoover up the metadata
git --no-pager log -1 --date=short --decorate=short \
--pretty=format:"\usepackage[%
shash={%h},
lhash={%H},
authname={%an},
authemail={%ae},
authsdate={%ad},
authidate={%ai},
authudate={%at},
commname={%cn},
commemail={%ce},
commsdate={%cd},
commidate={%ci},
commudate={%ct},
refnames={%d},
firsttagdescribe={$FIRSTTAG},
reltag={$RELTAG}
]{gitexinfo}" HEAD > .git/gitHeadInfo.gin
fichiers;dates;classe;message
loi_probabilite.beamer.tex loi_probabilite.article.tex;2020-04-20;2NDE7;<p>Cours de probabilité</p>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment