forked from ScoDoc/ScoDoc
Reorganized fakeportal files
This commit is contained in:
parent
de47a5e873
commit
2c9aacc330
@ -170,6 +170,6 @@ def pe_view_sem_recap(
|
||||
return send_file(
|
||||
data,
|
||||
mimetype="application/zip",
|
||||
download_name=jury.NOM_EXPORT_ZIP + ".zip",
|
||||
download_name=scu.sanitize_filename(jury.NOM_EXPORT_ZIP + ".zip"),
|
||||
as_attachment=True,
|
||||
)
|
||||
|
@ -1 +0,0 @@
|
||||
# Demo package
|
@ -15,7 +15,7 @@ import sys
|
||||
import random
|
||||
import psycopg2
|
||||
|
||||
from .gen_nomprenoms import nomprenom
|
||||
from gen_nomprenoms import nomprenom
|
||||
|
||||
|
||||
def usage():
|
@ -22,9 +22,9 @@
|
||||
<bourse>N</bourse>
|
||||
<paiementinscription>true</paiementinscription>
|
||||
<datefinalisationinscription></datefinalisationinscription>
|
||||
<ville_naissance>MEAUX</ville_naissance>
|
||||
<code_dep_naissance>099</code_dep_naissance>
|
||||
<libelle_dep_naissance>Etranger</libelle_dep_naissance>
|
||||
<ville_naissance>{ville_naissance}</ville_naissance>
|
||||
<code_dep_naissance>{code_dep_naissance}</code_dep_naissance>
|
||||
<libelle_dep_naissance>{libelle_dep_naissance}</libelle_dep_naissance>
|
||||
<cod_stu>01</cod_stu>
|
||||
<cod_rgi>1</cod_rgi>
|
||||
<tem_brs_iaa>N</tem_brs_iaa>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/python3
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""Simple fake HTTP serveur
|
||||
emulating "Apogee" Web service
|
||||
@ -13,12 +13,14 @@ import socketserver
|
||||
import sys
|
||||
import time
|
||||
|
||||
from tools.demo.gen_nomprenoms import nomprenom
|
||||
from gen_nomprenoms import nomprenom
|
||||
|
||||
cur_dir = Path(os.path.abspath(__file__)).parent
|
||||
|
||||
# Etudiant avec tous les champs (USPN)
|
||||
ETUD_TEMPLATE_FULL = open("etud_template.xml").read()
|
||||
ETUD_TEMPLATE_FULL = open(cur_dir / "etud_template.xml").read()
|
||||
# Etudiant avec seulement les champs requis
|
||||
ETUD_TEMPLATE_MINI = open("etud_minimal_template.xml").read()
|
||||
ETUD_TEMPLATE_MINI = open(cur_dir / "etud_minimal_template.xml").read()
|
||||
|
||||
ETUD_HEAD = """<?xml version="1.0" encoding="UTF-8"?>
|
||||
<etudiants>"""
|
||||
@ -44,6 +46,10 @@ def make_random_etud(nip, etape=None, annee=None, template=ETUD_TEMPLATE_FULL):
|
||||
etape=etape,
|
||||
diplome=diplome,
|
||||
annee=annee,
|
||||
ville_naissance=random.choice(("Paris", "Berlin", "Londres", "")),
|
||||
code_dep_naissance=random.choice(("75", "99", "89")),
|
||||
libelle_dep_naissance="nom département",
|
||||
# nomlycee=
|
||||
)
|
||||
return data
|
||||
|
||||
@ -130,11 +136,8 @@ class MyHttpRequestHandler(http.server.SimpleHTTPRequestHandler):
|
||||
return
|
||||
|
||||
|
||||
# Create an object of the above class
|
||||
handler_object = MyHttpRequestHandler
|
||||
|
||||
PORT = 8678
|
||||
my_server = socketserver.TCPServer(("", PORT), handler_object)
|
||||
my_server = socketserver.TCPServer(("", PORT), MyHttpRequestHandler)
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Start the server
|
||||
|
@ -7,10 +7,16 @@ from pathlib import Path
|
||||
cur_dir = Path(os.path.abspath(__file__)).parent
|
||||
|
||||
# Noms et prénoms les plus fréquents en France:
|
||||
NOMS = [x.strip() for x in open(cur_dir / "noms.txt").readlines()]
|
||||
PRENOMS_H = [x.strip() for x in open(cur_dir / "prenoms-h.txt").readlines()]
|
||||
PRENOMS_F = [x.strip() for x in open(cur_dir / "prenoms-f.txt").readlines()]
|
||||
PRENOMS_X = [x.strip() for x in open(cur_dir / "prenoms-x.txt").readlines()]
|
||||
NOMS = [x.strip() for x in open(cur_dir / "nomsprenoms" / "noms.txt").readlines()]
|
||||
PRENOMS_H = [
|
||||
x.strip() for x in open(cur_dir / "nomsprenoms" / "prenoms-h.txt").readlines()
|
||||
]
|
||||
PRENOMS_F = [
|
||||
x.strip() for x in open(cur_dir / "nomsprenoms" / "prenoms-f.txt").readlines()
|
||||
]
|
||||
PRENOMS_X = [
|
||||
x.strip() for x in open(cur_dir / "nomsprenoms" / "prenoms-x.txt").readlines()
|
||||
]
|
||||
|
||||
|
||||
def nomprenom(civilite):
|
Loading…
Reference in New Issue
Block a user