création du main
This commit is contained in:
parent
3a786f0f68
commit
eeac2f26aa
@ -261,20 +261,20 @@ def sauvegarde_ods(overpass_query_fields, data, nom_req):
|
||||
print("Sauvegarde résultats format ODS pour " + nom_req)
|
||||
|
||||
|
||||
def main():
|
||||
for req in requetes.reqs:
|
||||
|
||||
for nb_essai in range(max_retry):
|
||||
# on tente max_retry fois
|
||||
|
||||
try:
|
||||
|
||||
executer_requete_et_exporter_resultats(req.nom, req.critere, aire_de_recherche, req.champs)
|
||||
|
||||
executer_requete_et_exporter_resultats(
|
||||
req.nom, req.critere, aire_de_recherche, req.champs
|
||||
)
|
||||
break
|
||||
|
||||
except errors.Api_error:
|
||||
|
||||
if (nb_essai == max_retry) :
|
||||
if nb_essai == max_retry:
|
||||
print("trop d'erreurs d'API - abandon")
|
||||
exit()
|
||||
|
||||
@ -282,6 +282,8 @@ for req in requetes.reqs :
|
||||
|
||||
time.sleep(retry_delay)
|
||||
|
||||
|
||||
|
||||
print("Fini")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
Loading…
Reference in New Issue
Block a user