09/02/23 - 11h

master
cherif 2023-02-09 11:25:37 +01:00
parent a526600b02
commit 92170635f1
9 changed files with 71162 additions and 88 deletions

View File

@ -1,17 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="1122d9e2-679f-46d6-8c4f-97e9ae4041b5" name="Changes" comment="01/02/23 - 22h"> <list default="true" id="1122d9e2-679f-46d6-8c4f-97e9ae4041b5" name="Changes" comment="05/02/23 - 20h">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Emargement/fichier_presence.pdf" beforeDir="false" afterPath="$PROJECT_DIR$/Emargement/fichier_presence.pdf" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Emargement/fichier_presence.pdf" beforeDir="false" afterPath="$PROJECT_DIR$/Emargement/fichier_presence.pdf" 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$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/class_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/class_mgt.py" 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$/data_indexees.csv" beforeDir="false" afterPath="$PROJECT_DIR$/data_indexees.csv" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ela_index_bdd_classes.py" beforeDir="false" afterPath="$PROJECT_DIR$/ela_index_bdd_classes.py" 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$/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$/email_inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/email_inscription_mgt.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/email_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/email_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tools_cherif/tools_cherif.py" beforeDir="false" afterPath="$PROJECT_DIR$/tools_cherif/tools_cherif.py" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -273,7 +272,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1675282357129</updated> <updated>1675282357129</updated>
</task> </task>
<option name="localTasksCounter" value="29" /> <task id="LOCAL-00029" summary="05/02/23 - 20h">
<created>1675623091527</created>
<option name="number" value="00029" />
<option name="presentableId" value="LOCAL-00029" />
<option name="project" value="LOCAL" />
<updated>1675623091527</updated>
</task>
<option name="localTasksCounter" value="30" />
<servers /> <servers />
</component> </component>
<component name="Vcs.Log.Tabs.Properties"> <component name="Vcs.Log.Tabs.Properties">
@ -288,7 +294,6 @@
</option> </option>
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="22/11/22 - 11h30" />
<MESSAGE value="22/11/22 - 22h30" /> <MESSAGE value="22/11/22 - 22h30" />
<MESSAGE value="23/11/22 - 22h30" /> <MESSAGE value="23/11/22 - 22h30" />
<MESSAGE value="26/11/22 - 10h30" /> <MESSAGE value="26/11/22 - 10h30" />
@ -313,7 +318,8 @@
<MESSAGE value="27/01:23 - 19h" /> <MESSAGE value="27/01:23 - 19h" />
<MESSAGE value="30/01/23 - 22h" /> <MESSAGE value="30/01/23 - 22h" />
<MESSAGE value="01/02/23 - 22h" /> <MESSAGE value="01/02/23 - 22h" />
<option name="LAST_COMMIT_MESSAGE" value="01/02/23 - 22h" /> <MESSAGE value="05/02/23 - 20h" />
<option name="LAST_COMMIT_MESSAGE" value="05/02/23 - 20h" />
</component> </component>
<component name="XDebuggerManager"> <component name="XDebuggerManager">
<breakpoint-manager> <breakpoint-manager>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -286,6 +286,7 @@ def add_class(diction):
local_val = local_val[:-1] local_val = local_val[:-1]
nb_keyword = local_val.split(";") nb_keyword = local_val.split(";")
if(len(str(local_val).strip()) > 0 and len(nb_keyword) > 0 ):
for local_nb_keyword in nb_keyword: for local_nb_keyword in nb_keyword:
if (len(str(local_nb_keyword).strip()) <= 0): if (len(str(local_nb_keyword).strip()) <= 0):
mycommon.myprint( mycommon.myprint(
@ -539,7 +540,10 @@ def add_class(diction):
if (local_tmp[0] and "ranking" in local_tmp[0].keys()): if (local_tmp[0] and "ranking" in local_tmp[0].keys()):
if local_tmp[0]['ranking']: if local_tmp[0]['ranking']:
#print(" ### le ranking du pack est " + str(local_tmp[0]['ranking'])) #print(" ### le ranking du pack est " + str(local_tmp[0]['ranking']))
mydata['display_rank'] = str(local_tmp[0]['ranking']) ##mydata['display_rank'] = str(local_tmp[0]['ranking'])
## for demo only
mydata['display_rank'] = "999"
coll_name = MYSY_GV.dbname['myclass'] coll_name = MYSY_GV.dbname['myclass']
@ -793,19 +797,21 @@ def update_class(diction):
mots_cle = mots_cle[:-1] mots_cle = mots_cle[:-1]
nb_keyword = mots_cle.split(";") nb_keyword = mots_cle.split(";")
if(len(str(mots_cle).strip()) > 0 and len(nb_keyword) > 0 ):
for local_nb_keyword in nb_keyword: for local_nb_keyword in nb_keyword:
if (len(str(local_nb_keyword).strip()) <= 0): if (len(str(local_nb_keyword).strip()) <= 0):
mycommon.myprint( mycommon.myprint(
str(inspect.stack()[0][3]) + " : La formation " + str( str(inspect.stack()[0][3]) + " : La formation " + str(
mydata['external_code']) + "contient des valeurs vides") diction['external_code']) + " contient des valeurs vides (1)")
return False, " La formation " + str(mydata['external_code']) + " contient des valeurs vides" return False, " La formation " + str(diction['external_code']) + " contient des valeurs vides"
if (len(nb_keyword) > MYSY_GV.MAX_KEYWORD): if (len(nb_keyword) > MYSY_GV.MAX_KEYWORD):
mycommon.myprint( mycommon.myprint(
str(inspect.stack()[0][3]) + " : La formation " + str( str(inspect.stack()[0][3]) + " : La formation " + str(
mydata['external_code']) + " a plus de " + str(MYSY_GV.MAX_KEYWORD) + " mots clés") diction['external_code']) + " a plus de " + str(MYSY_GV.MAX_KEYWORD) + " mots clés")
return False, " La formation " + str(mydata['external_code']) + " a plus de " + str( return False, " La formation " + str(diction['external_code']) + " a plus de " + str(
MYSY_GV.MAX_KEYWORD) + " mots clés" MYSY_GV.MAX_KEYWORD) + " mots clés"
@ -1027,7 +1033,10 @@ def update_class(diction):
if (local_tmp[0] and "ranking" in local_tmp[0].keys()): if (local_tmp[0] and "ranking" in local_tmp[0].keys()):
if local_tmp[0]['ranking']: if local_tmp[0]['ranking']:
print(" ### le ranking du pack est "+str(local_tmp[0]['ranking']) ) print(" ### le ranking du pack est "+str(local_tmp[0]['ranking']) )
mydata['display_rank'] = str(local_tmp[0]['ranking']) #mydata['display_rank'] = str(local_tmp[0]['ranking'])
## For demo only
mydata['display_rank'] = "999"
@ -2884,11 +2893,12 @@ def add_class_mass(file=None, Folder=None, diction=None):
mots_cle = mots_cle[:-1] mots_cle = mots_cle[:-1]
nb_keyword = mots_cle.split(";") nb_keyword = mots_cle.split(";")
if(len(str(mots_cle).strip()) > 0 and len(nb_keyword) > 0 ):
for local_nb_keyword in nb_keyword: for local_nb_keyword in nb_keyword:
if(len(str(local_nb_keyword).strip()) <= 0 ): if(len(str(local_nb_keyword).strip()) <= 0 ):
mycommon.myprint( mycommon.myprint(
str(inspect.stack()[0][3]) + " : La formation " + str( str(inspect.stack()[0][3]) + " : La formation " + str(
mydata['external_code']) + "contient des valeur vide") mydata['external_code']) + " contient des valeur vide (2)")
return False, " La formation " + str(mydata['external_code']) + " contient des valeurs vides" return False, " La formation " + str(mydata['external_code']) + " contient des valeurs vides"

View File

@ -1,3 +1,5 @@
,index,mots,occurence,moyenne,id_formation,source_field ,index,mots,occurence,moyenne,id_formation,source_field
0,0,foundation,1,0.5,MYSY_0003,title 0,0,electrique,1,0.17,MYSY_0001,title
1,1,agilepm,1,0.5,MYSY_0003,title 1,1,b,2,0.33,MYSY_0001,title
2,2,v,2,0.33,MYSY_0001,title
3,3,habilitation,1,0.17,MYSY_0001,title

1 index mots occurence moyenne id_formation source_field
2 0 0 foundation electrique 1 0.5 0.17 MYSY_0003 MYSY_0001 title
3 1 1 agilepm b 1 2 0.5 0.33 MYSY_0003 MYSY_0001 title
4 2 2 v 2 0.33 MYSY_0001 title
5 3 3 habilitation 1 0.17 MYSY_0001 title

View File

@ -1,3 +1,3 @@
mots occurence moyenne id_formation source_field Empty DataFrame
0 foundation 1 0.5 MYSY_0003 title Columns: [mots, occurence, moyenne, id_formation, source_field]
1 agilepm 1 0.5 MYSY_0003 title Index: []

View File

@ -1846,14 +1846,14 @@ def ManualSendInvoiceEmailRIB(diction):
TEMPLATE_FILE = "Template/MySy_Invoice_RIB_tpl.html" TEMPLATE_FILE = "Template/MySy_Invoice_RIB_tpl.html"
template = templateEnv.get_template(TEMPLATE_FILE) template = templateEnv.get_template(TEMPLATE_FILE)
body = { body = {
"params": {"order_id": "004G", "params": {"order_id": "005G",
"date_order": ": 01/01/2023", "date_order": ": 01/02/2023",
"total_ht": "90", "total_ht": "150",
"tva": "18", "tva": "0",
"total_ttc": "108", "total_ttc": "150",
"client_name": "5DISCOVERY", "client_name": "HIFMI-INSTITUTE",
"client_address": "7bis Rue du 13ème de ligne", "client_address": "50 AV PIERRE ET MARIE CURIE",
"client_zip_ville": "58000 Nevers", "client_zip_ville": "93700 DRANCY",
"client_pays": "France", "client_pays": "France",
"packs": "PACK GOLD ", "packs": "PACK GOLD ",
"detail_packs": "-- Support téléphonique -- " "detail_packs": "-- Support téléphonique -- "
@ -1864,13 +1864,13 @@ def ManualSendInvoiceEmailRIB(diction):
"Publication d'un article -- " "Publication d'un article -- "
"Reporting Dynamique et personnalisé", "Reporting Dynamique et personnalisé",
"qty": "1", "qty": "3",
"unit_price": "90", "unit_price": "50",
"montant": "90", "montant": "150",
"invoice_id": "FACT_230200020", "invoice_id": "FACT_230200021",
"invoice_date": "01/02/2023", "invoice_date": "07/02/2023",
"due_date": "01/02/2022", "due_date": "07/02/2022",
"orign_order": "Contrat 004G", "orign_order": "Contrat 005G",
} }
} }
sourceHtml = template.render(params=body["params"]) sourceHtml = template.render(params=body["params"])

18
main.py
View File

@ -2304,6 +2304,24 @@ def email_validation():
localStatus, message= tools_cherif.email_validation() localStatus, message= tools_cherif.email_validation()
return jsonify(status=localStatus, message=message ) return jsonify(status=localStatus, message=message )
@app.route('/myclass/api/email_validation_mairies/', methods=['POST','GET'])
@crossdomain(origin='*')
def email_validation_mairies():
# On recupere le corps (payload) de la requete
payload = request.form.to_dict()
print(" ### email_validation_mairies : payload = ",payload)
localStatus, message= tools_cherif.email_validation_mairies()
return jsonify(status=localStatus, message=message )
@app.route('/myclass/api/email_validation_hopitaux_ehpad/', methods=['POST','GET'])
@crossdomain(origin='*')
def email_validation_hopitaux_ehpad():
# On recupere le corps (payload) de la requete
payload = request.form.to_dict()
print(" ### email_validation_hopitaux_ehpad : payload = ",payload)
localStatus, message= tools_cherif.email_validation_hopitaux_ehpad()
return jsonify(status=localStatus, message=message )
""" """
Cette API permet de desabonner une personne Cette API permet de desabonner une personne

View File

@ -80,3 +80,128 @@ def email_validation():
exc_type, exc_obj, exc_tb = sys.exc_info() exc_type, exc_obj, exc_tb = sys.exc_info()
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno)) mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
return False, " Impossible de recuperer la formation" return False, " Impossible de recuperer la formation"
def email_validation_mairies():
try:
coll_emails = MYSY_GV.dbname['collect_list_mairies']
cpt = 0
nb_doc = coll_emails.count_documents({'valide': '1', "email_checked": {"$ne": "1"}})
print(" ### nb_doc = ", nb_doc)
for val in coll_emails.find({'valide': '1', "checked": {"$ne": "1"}}):
cpt = cpt + 1
if ("email" in val.keys()):
is_valid = validate_email(
email_address=str(val['email']).strip(),
check_format=True,
check_blacklist=True,
check_dns=True,
dns_timeout=10,
check_smtp=True,
smtp_timeout=10,
smtp_helo_host='smtp.office365.com',
smtp_from_address='support@mysy-training.com',
smtp_skip_tls=False,
smtp_tls_context=None,
smtp_debug=False)
retval = ""
checked_status = ""
if (is_valid):
# print(" ### l'adresse ",val['email_address']," est valide ")
retval = True
checked_status = "1"
else:
# print(" ### l'adresse ", val['email_address'], " N'EST PAS valide ")
retval = False
checked_status = "0"
mydata = {}
mytoday = datetime.today().strftime("%d/%m/%Y")
mydata['last_check_date'] = str(mytoday)[0:10]
mydata['email_checked'] = str("1")
mydata['email_checked_status'] = str(checked_status)
ret_val = coll_emails.find_one_and_update(
{'email': str(val['email']), 'valide': '1'},
{"$set": mydata},
return_document=ReturnDocument.AFTER
)
print(" ### " + str(cpt) + " / " + str(nb_doc))
return retval, str(cpt) + " adresse email ont été mise à jour "
except Exception as e:
exc_type, exc_obj, exc_tb = sys.exc_info()
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
return False, " Impossible de recuperer la formation"
def email_validation_hopitaux_ehpad():
try:
coll_emails = MYSY_GV.dbname['collect_list_hopitaux_ehpad']
cpt = 0
nb_doc = coll_emails.count_documents({'valide': '1', "email_checked": {"$ne": "1"}})
print(" ### nb_doc = ", nb_doc)
for val in coll_emails.find({'valide': '1', "checked": {"$ne": "1"}}):
cpt = cpt + 1
if ("email" in val.keys()):
is_valid = validate_email(
email_address=str(val['email']).strip(),
check_format=True,
check_blacklist=True,
check_dns=True,
dns_timeout=10,
check_smtp=True,
smtp_timeout=10,
smtp_helo_host='smtp.office365.com',
smtp_from_address='support@mysy-training.com',
smtp_skip_tls=False,
smtp_tls_context=None,
smtp_debug=False)
retval = ""
checked_status = ""
if (is_valid):
# print(" ### l'adresse ",val['email_address']," est valide ")
retval = True
checked_status = "1"
else:
# print(" ### l'adresse ", val['email_address'], " N'EST PAS valide ")
retval = False
checked_status = "0"
mydata = {}
mytoday = datetime.today().strftime("%d/%m/%Y")
mydata['last_check_date'] = str(mytoday)[0:10]
mydata['email_checked'] = str("1")
mydata['email_checked_status'] = str(checked_status)
ret_val = coll_emails.find_one_and_update(
{'email': str(val['email']), 'valide': '1'},
{"$set": mydata},
return_document=ReturnDocument.AFTER
)
print(" ### " + str(cpt) + " / " + str(nb_doc))
return retval, str(cpt) + " adresse email ont été mise à jour "
except Exception as e:
exc_type, exc_obj, exc_tb = sys.exc_info()
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
return False, " Impossible de recuperer la formation"