Better naming

This commit is contained in:
Rémi Oudin 2018-02-25 11:49:44 +01:00
parent ee32e5385b
commit 7c0fb7dda1

View file

@ -68,18 +68,19 @@ def generate_partial_history(user, t_start):
""" Generate the part of the history resulting from the crawl starting at """ Generate the part of the history resulting from the crawl starting at
the given url. the given url.
""" """
timestamp = t_start
result = [] result = []
basis = generate_first_url(user) basis = generate_first_url(user)
result.append((basis, t_start)) result.append((basis, timestamp))
t_start += 5* random.weibullvariate(1, 1.5) timestamp += 5* random.weibullvariate(1, 1.5)
queue = Queue() queue = Queue()
crawler = crawl.CrawlingThread(user, basis, queue) crawler = crawl.CrawlingThread(user, basis, queue)
crawler.start() crawler.start()
crawler.join() crawler.join()
urls = queue.get() urls = queue.get()
for url in urls: for url in urls:
t_start += 5* random.weibullvariate(1, 1.5) timestamp += 5* random.weibullvariate(1, 1.5)
result.append((url, t_start) result.append((url, timestamp))
return result return result
def generate_first_url(user): def generate_first_url(user):