modal implementation #12

Merged
vincent merged 10 commits from dev into master 2019-05-11 14:21:09 +00:00
Showing only changes of commit c32aa69b89 - Show all commits

View File

@ -2,12 +2,13 @@ from bs4 import BeautifulSoup
import urllib.request
import re
from datetime import datetime, timedelta
from time import sleep
#debug
#import pprint
class Emmission(object):
loading = False
def __init__(self):
self._LoadreferencePage()
@ -19,11 +20,17 @@ class Emmission(object):
return None
print("load")
self.html = BeautifulSoup(response.read(),"html.parser")
self.timeexp=datetime.utcnow() +timedelta(minutes=5)
self.timeexp=datetime.utcnow() +timedelta(seconds=30)
def parse_emmission(self,strsearch):
if (datetime.utcnow() > self.timeexp):
if ((datetime.utcnow() > self.timeexp) and (self.loading == False)):
self.loading = True
self._LoadreferencePage()
self.loading = False
else:
while(self.loading):
sleep(0.1)
pass
strsearch=strsearch.replace('É','E')
linkchaine=self.html.find(text=re.compile(re.escape(strsearch)))
if linkchaine == None: