29/01/23 - 20h

master
cherif 2023-01-29 20:40:22 +01:00
parent 472c4e5a1e
commit 1935680648
9 changed files with 5426 additions and 32 deletions

View File

@ -1,8 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="1122d9e2-679f-46d6-8c4f-97e9ae4041b5" name="Changes" comment="27/01/23 - 15h">
<list default="true" id="1122d9e2-679f-46d6-8c4f-97e9ae4041b5" name="Changes" comment="27/01:23 - 19h">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/GlobalVariable.py" beforeDir="false" afterPath="$PROJECT_DIR$/GlobalVariable.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/Inscription_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/class_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/class_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/data_indexees.csv" beforeDir="false" afterPath="$PROJECT_DIR$/data_indexees.csv" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ela_output_test_file_pandas_2.txt" beforeDir="false" afterPath="$PROJECT_DIR$/ela_output_test_file_pandas_2.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/emargement.py" beforeDir="false" afterPath="$PROJECT_DIR$/emargement.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -243,7 +251,14 @@
<option name="project" value="LOCAL" />
<updated>1674831515253</updated>
</task>
<option name="localTasksCounter" value="26" />
<task id="LOCAL-00026" summary="27/01:23 - 19h">
<created>1674844418103</created>
<option name="number" value="00026" />
<option name="presentableId" value="LOCAL-00026" />
<option name="project" value="LOCAL" />
<updated>1674844418103</updated>
</task>
<option name="localTasksCounter" value="27" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -258,7 +273,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="sss" />
<MESSAGE value="sss - init new pc" />
<MESSAGE value="18/11/22 - 23h30" />
<MESSAGE value="22/11/22 - 11h30" />
@ -283,7 +297,8 @@
<MESSAGE value="25/01/23 - 16h" />
<MESSAGE value="25/01/23 - 20h" />
<MESSAGE value="27/01/23 - 15h" />
<option name="LAST_COMMIT_MESSAGE" value="27/01/23 - 15h" />
<MESSAGE value="27/01:23 - 19h" />
<option name="LAST_COMMIT_MESSAGE" value="27/01:23 - 19h" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>

View File

@ -221,17 +221,27 @@ SENDINBLUE_API_KEY_SUPPORT = "xkeysib-f307361b68d4b0a7ef03dea586f193e14a3a9f9e30
"""
Variable SMTP de OFFICE 365, suite a l'abandon de sendinblu comme relay stmp
"""
O365_SMTP_COUNT_password = 'Xad47198'
O365_SMTP_COUNT_smtpsrv = "smtp.office365.com"
O365_SMTP_COUNT_user = "support@mysy-training.com"
O365_SMTP_COUNT_From_User = "support@mysy-training.com"
O365_SMTP_COUNT_port = 587
if (MYSY_ENV == "PROD"):
O365_SMTP_COUNT_password = 'Xad47198'
O365_SMTP_COUNT_smtpsrv = "smtp.office365.com"
O365_SMTP_COUNT_user = "support@mysy-training.com"
O365_SMTP_COUNT_From_User = "support@mysy-training.com"
O365_SMTP_COUNT_port = 587
#O365_SMTP_COUNT_password = 'GomboyaVince1234+'
#O365_SMTP_COUNT_smtpsrv = "smtp.office365.com"
#O365_SMTP_COUNT_user = "cbalde@mysy-training.com"
#O365_SMTP_COUNT_From_User = "cbalde@mysy-training.com"
#O365_SMTP_COUNT_port = 587
if (MYSY_ENV == "REC"):
O365_SMTP_COUNT_password = 'Xad47198'
O365_SMTP_COUNT_smtpsrv = "smtp.office365.com"
O365_SMTP_COUNT_user = "support@mysy-training.com"
O365_SMTP_COUNT_From_User = "support@mysy-training.com"
O365_SMTP_COUNT_port = 587
if (MYSY_ENV == "DEV"):
O365_SMTP_COUNT_password = 'GomboyaVince1234+'
O365_SMTP_COUNT_smtpsrv = "smtp.office365.com"
O365_SMTP_COUNT_user = "cbalde@mysy-training.com"
O365_SMTP_COUNT_From_User = "cbalde@mysy-training.com"
O365_SMTP_COUNT_port = 587
"""
Repertoire temporaire de telechargement ou de creation de fichier
@ -277,6 +287,6 @@ Limite des zones de texte des formation
- objectif
- description
"""
CLASS_ZONE_PROGRAM_LIMIT = 700
CLASS_ZONE_DESCRIP_LIMIT = 700
CLASS_ZONE_OBJECTIF_LIMIT = 300
CLASS_ZONE_PROGRAM_LIMIT = 1000
CLASS_ZONE_DESCRIP_LIMIT = 1000
CLASS_ZONE_OBJECTIF_LIMIT = 1000

View File

@ -58,14 +58,14 @@ def AddStagiairetoClass(diction):
"""
Verification de la liste des champs obligatoires
"""
field_list_obligatoire = ['nom', 'prenom', 'email', 'telephone', 'modefinancement', 'opco',
field_list_obligatoire = ['nom', 'prenom', 'email', 'telephone', 'modefinancement',
'class_internal_url', 'session_id']
for val in field_list_obligatoire:
if val not in diction:
mycommon.myprint(
str(inspect.stack()[0][3]) + " - : La valeur '" + val + "' n'est pas presente dans liste ")
return False, "Impossible de créer le stagiaire, Toutes les informations necessaires n'ont pas été fournies"
return False, "Impossible de créer le stagiaire. La valeur '" + val + "' n'est pas presente dans liste"
mydata = {}

File diff suppressed because it is too large Load Diff

View File

@ -166,7 +166,7 @@ def add_class(diction):
if (len(mycommon.cleanhtml(diction['objectif'])) > MYSY_GV.CLASS_ZONE_OBJECTIF_LIMIT):
mycommon.myprint(
str(inspect.stack()[0][3]) + " : le champ 'objectif' de La formation " + str(
mydata['external_code']) + " a plus de " + str(MYSY_GV.CLASS_ZONE_OBJECTIF_LIMIT) + " caractères")
diction['external_code']) + " a plus de " + str(MYSY_GV.CLASS_ZONE_OBJECTIF_LIMIT) + " caractères")
return False, " le champ 'objectif' de La formation " + str(
mydata['external_code']) + " a plus de " + str(MYSY_GV.CLASS_ZONE_OBJECTIF_LIMIT) + " caractères"
@ -194,7 +194,7 @@ def add_class(diction):
if (len(mycommon.cleanhtml(diction['description'])) > MYSY_GV.CLASS_ZONE_DESCRIP_LIMIT):
mycommon.myprint(
str(inspect.stack()[0][3]) + " : le champ 'description' de La formation " + str(
mydata['external_code']) + " a plus de " + str(
diction['external_code']) + " a plus de " + str(
MYSY_GV.CLASS_ZONE_DESCRIP_LIMIT) + " caractères")
return False, " le champ 'description' de La formation " + str(
mydata['external_code']) + " a plus de " + str(MYSY_GV.CLASS_ZONE_DESCRIP_LIMIT) + " caractères"
@ -656,7 +656,7 @@ def update_class(diction):
if (len(mycommon.cleanhtml(diction['objectif'])) > MYSY_GV.CLASS_ZONE_OBJECTIF_LIMIT):
mycommon.myprint(
str(inspect.stack()[0][3]) + " : le champ 'objectif' de La formation " + str(
mydata['external_code']) + " a plus de " + str(
diction['external_code']) + " a plus de " + str(
MYSY_GV.CLASS_ZONE_OBJECTIF_LIMIT) + " caractères")
return False, " le champ 'objectif' de La formation " + str(
diction['external_code']) + " a plus de " + str(MYSY_GV.CLASS_ZONE_OBJECTIF_LIMIT) + " caractères"
@ -667,7 +667,7 @@ def update_class(diction):
if (len(mycommon.cleanhtml(diction['programme'])) > MYSY_GV.CLASS_ZONE_PROGRAM_LIMIT):
mycommon.myprint(
str(inspect.stack()[0][3]) + " : le champ 'Progamme' de La formation " + str(
mydata['external_code']) + " a plus de " + str(
diction['external_code']) + " a plus de " + str(
MYSY_GV.CLASS_ZONE_PROGRAM_LIMIT) + " caractères")
return False, " le champ 'Progamme' de La formation " + str(
diction['external_code']) + " a plus de " + str(MYSY_GV.CLASS_ZONE_PROGRAM_LIMIT) + " caractères"
@ -707,10 +707,13 @@ def update_class(diction):
if ("description" in diction.keys()):
mydata['description'] = diction['description']
print(" #### ",mycommon.cleanhtml(diction['description']))
print(" ### len =", len(mycommon.cleanhtml(diction['description'])))
if (len(mycommon.cleanhtml(diction['description'])) > MYSY_GV.CLASS_ZONE_DESCRIP_LIMIT):
mycommon.myprint(
str(inspect.stack()[0][3]) + " : le champ 'description' de La formation " + str(
mydata['external_code']) + " a plus de " + str(
diction['external_code']) + " a plus de " + str(
MYSY_GV.CLASS_ZONE_DESCRIP_LIMIT) + " caractères")
return False, " le champ 'description' de La formation " + str(
diction['external_code']) + " a plus de " + str(MYSY_GV.CLASS_ZONE_DESCRIP_LIMIT) + " caractères"

View File

@ -1,3 +1,3 @@
,index,mots,occurence,moyenne,id_formation,source_field
0,0,management,1,0.5,MYSY_10022,title
1,1,fondamentau,1,0.5,MYSY_10022,title
0,0,management,1,0.5,MYSY_1000forma2,title
1,1,fondamentau,1,0.5,MYSY_1000forma2,title

1 index mots occurence moyenne id_formation source_field
2 0 0 management 1 0.5 MYSY_10022 MYSY_1000forma2 title
3 1 1 fondamentau 1 0.5 MYSY_10022 MYSY_1000forma2 title

View File

@ -1,3 +1,3 @@
mots occurence moyenne id_formation source_field
0 management 1 0.5 MYSY_10022 title
1 fondamentau 1 0.5 MYSY_10022 title
Empty DataFrame
Columns: [mots, occurence, moyenne, id_formation, source_field]
Index: []

View File

@ -100,9 +100,19 @@ def CreateTableauEmargement(diction):
date_du = str(tmp_val['date_debut'])[0:10]
date_au = str(tmp_val['date_fin'])[0:10]
ville = tmp_val['ville']
code_postal = tmp_val['code_postal']
adresse = tmp_val['adresse']
ville = ""
if ("ville" in tmp_val.keys() and tmp_val['ville']):
ville = tmp_val['ville']
code_postal = ""
if ("code_postal" in tmp_val.keys() and tmp_val['code_postal']):
code_postal = tmp_val['code_postal']
adresse = ""
if ("adresse" in tmp_val.keys() and tmp_val['adresse']):
adresse = tmp_val['adresse']
is_date_du = mycommon.CheckisDate(date_du)
is_date_au = mycommon.CheckisDate(date_au)

View File

@ -39,6 +39,7 @@ from xhtml2pdf import pisa
import jinja2
import ftplib
import pysftp
import html
class JSONEncoder(json.JSONEncoder):
def default(self, o):
@ -2680,6 +2681,7 @@ Cette fonction retourne un texte sans les tag html
def cleanhtml(raw_html):
CLEANR = re.compile('<.*?>')
cleantext = re.sub(CLEANR, '', raw_html).replace("&nbsp;", "")
cleantext = html.unescape(str(cleantext))
return cleantext
"""