09/02/23 - 11h
parent
a526600b02
commit
92170635f1
|
@ -1,17 +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="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$/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$/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$/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$/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>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -273,7 +272,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1675282357129</updated>
|
||||
</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 />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -288,7 +294,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="22/11/22 - 11h30" />
|
||||
<MESSAGE value="22/11/22 - 22h30" />
|
||||
<MESSAGE value="23/11/22 - 22h30" />
|
||||
<MESSAGE value="26/11/22 - 10h30" />
|
||||
|
@ -313,7 +318,8 @@
|
|||
<MESSAGE value="27/01:23 - 19h" />
|
||||
<MESSAGE value="30/01/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 name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
|
|
File diff suppressed because one or more lines are too long
70885
Log/log_file.log
70885
Log/log_file.log
File diff suppressed because one or more lines are too long
74
class_mgt.py
74
class_mgt.py
|
@ -286,14 +286,15 @@ def add_class(diction):
|
|||
local_val = local_val[:-1]
|
||||
|
||||
nb_keyword = local_val.split(";")
|
||||
for local_nb_keyword in nb_keyword:
|
||||
if (len(str(local_nb_keyword).strip()) <= 0):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " : La formation " + str(
|
||||
mydata['external_code']) + "contient des valeurs vides")
|
||||
if(len(str(local_val).strip()) > 0 and len(nb_keyword) > 0 ):
|
||||
for local_nb_keyword in nb_keyword:
|
||||
if (len(str(local_nb_keyword).strip()) <= 0):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " : La formation " + str(
|
||||
mydata['external_code']) + " contient des valeurs vides")
|
||||
|
||||
return False, " La formation " + str(
|
||||
mydata['external_code']) + " contient des valeurs vides"
|
||||
return False, " La formation " + str(
|
||||
mydata['external_code']) + " contient des valeurs vides"
|
||||
|
||||
|
||||
nb_keyword = local_val.split(";")
|
||||
|
@ -539,7 +540,10 @@ def add_class(diction):
|
|||
if (local_tmp[0] and "ranking" in local_tmp[0].keys()):
|
||||
if 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']
|
||||
|
@ -793,20 +797,22 @@ def update_class(diction):
|
|||
mots_cle = mots_cle[:-1]
|
||||
|
||||
nb_keyword = mots_cle.split(";")
|
||||
for local_nb_keyword in nb_keyword:
|
||||
if (len(str(local_nb_keyword).strip()) <= 0):
|
||||
|
||||
if(len(str(mots_cle).strip()) > 0 and len(nb_keyword) > 0 ):
|
||||
for local_nb_keyword in nb_keyword:
|
||||
if (len(str(local_nb_keyword).strip()) <= 0):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " : La formation " + str(
|
||||
diction['external_code']) + " contient des valeurs vides (1)")
|
||||
|
||||
return False, " La formation " + str(diction['external_code']) + " contient des valeurs vides"
|
||||
|
||||
if (len(nb_keyword) > MYSY_GV.MAX_KEYWORD):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " : La formation " + str(
|
||||
mydata['external_code']) + "contient des valeurs vides")
|
||||
|
||||
return False, " La formation " + str(mydata['external_code']) + " contient des valeurs vides"
|
||||
|
||||
if (len(nb_keyword) > MYSY_GV.MAX_KEYWORD):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " : La formation " + str(
|
||||
mydata['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(
|
||||
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(diction['external_code']) + " a plus de " + str(
|
||||
MYSY_GV.MAX_KEYWORD) + " mots clés"
|
||||
|
||||
|
||||
mydata['mots_cle'] =mots_cle
|
||||
|
@ -1027,7 +1033,10 @@ def update_class(diction):
|
|||
if (local_tmp[0] and "ranking" in local_tmp[0].keys()):
|
||||
if 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,18 +2893,19 @@ def add_class_mass(file=None, Folder=None, diction=None):
|
|||
mots_cle = mots_cle[:-1]
|
||||
|
||||
nb_keyword = mots_cle.split(";")
|
||||
for local_nb_keyword in nb_keyword:
|
||||
if(len(str(local_nb_keyword).strip()) <= 0 ):
|
||||
if(len(str(mots_cle).strip()) > 0 and len(nb_keyword) > 0 ):
|
||||
for local_nb_keyword in nb_keyword:
|
||||
if(len(str(local_nb_keyword).strip()) <= 0 ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " : La formation " + str(
|
||||
mydata['external_code']) + " contient des valeur vide (2)")
|
||||
|
||||
return False, " La formation " + str(mydata['external_code']) + " contient des valeurs vides"
|
||||
|
||||
if( len(nb_keyword) > MYSY_GV.MAX_KEYWORD ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " : La formation " + str(
|
||||
mydata['external_code']) + "contient des valeur vide")
|
||||
|
||||
return False, " La formation " + str(mydata['external_code']) + " contient des valeurs vides"
|
||||
|
||||
if( len(nb_keyword) > MYSY_GV.MAX_KEYWORD ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " : La formation "+str(mydata['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(MYSY_GV.MAX_KEYWORD)+" mots clés"
|
||||
str(inspect.stack()[0][3]) + " : La formation "+str(mydata['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(MYSY_GV.MAX_KEYWORD)+" mots clés"
|
||||
|
||||
mydata['mots_cle'] = mots_cle
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
,index,mots,occurence,moyenne,id_formation,source_field
|
||||
0,0,foundation,1,0.5,MYSY_0003,title
|
||||
1,1,agilepm,1,0.5,MYSY_0003,title
|
||||
0,0,electrique,1,0.17,MYSY_0001,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,3 +1,3 @@
|
|||
mots occurence moyenne id_formation source_field
|
||||
0 foundation 1 0.5 MYSY_0003 title
|
||||
1 agilepm 1 0.5 MYSY_0003 title
|
||||
Empty DataFrame
|
||||
Columns: [mots, occurence, moyenne, id_formation, source_field]
|
||||
Index: []
|
30
email_mgt.py
30
email_mgt.py
|
@ -1846,14 +1846,14 @@ def ManualSendInvoiceEmailRIB(diction):
|
|||
TEMPLATE_FILE = "Template/MySy_Invoice_RIB_tpl.html"
|
||||
template = templateEnv.get_template(TEMPLATE_FILE)
|
||||
body = {
|
||||
"params": {"order_id": "004G",
|
||||
"date_order": ": 01/01/2023",
|
||||
"total_ht": "90",
|
||||
"tva": "18",
|
||||
"total_ttc": "108",
|
||||
"client_name": "5DISCOVERY",
|
||||
"client_address": "7bis Rue du 13ème de ligne",
|
||||
"client_zip_ville": "58000 Nevers",
|
||||
"params": {"order_id": "005G",
|
||||
"date_order": ": 01/02/2023",
|
||||
"total_ht": "150",
|
||||
"tva": "0",
|
||||
"total_ttc": "150",
|
||||
"client_name": "HIFMI-INSTITUTE",
|
||||
"client_address": "50 AV PIERRE ET MARIE CURIE",
|
||||
"client_zip_ville": "93700 DRANCY",
|
||||
"client_pays": "France",
|
||||
"packs": "PACK GOLD ",
|
||||
"detail_packs": "-- Support téléphonique -- "
|
||||
|
@ -1864,13 +1864,13 @@ def ManualSendInvoiceEmailRIB(diction):
|
|||
"Publication d'un article -- "
|
||||
"Reporting Dynamique et personnalisé",
|
||||
|
||||
"qty": "1",
|
||||
"unit_price": "90",
|
||||
"montant": "90",
|
||||
"invoice_id": "FACT_230200020",
|
||||
"invoice_date": "01/02/2023",
|
||||
"due_date": "01/02/2022",
|
||||
"orign_order": "Contrat 004G",
|
||||
"qty": "3",
|
||||
"unit_price": "50",
|
||||
"montant": "150",
|
||||
"invoice_id": "FACT_230200021",
|
||||
"invoice_date": "07/02/2023",
|
||||
"due_date": "07/02/2022",
|
||||
"orign_order": "Contrat 005G",
|
||||
}
|
||||
}
|
||||
sourceHtml = template.render(params=body["params"])
|
||||
|
|
18
main.py
18
main.py
|
@ -2304,6 +2304,24 @@ def email_validation():
|
|||
localStatus, message= tools_cherif.email_validation()
|
||||
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
|
||||
|
|
|
@ -79,4 +79,129 @@ def email_validation():
|
|||
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"
|
||||
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"
|
||||
|
||||
|
|
Loading…
Reference in New Issue