From 7c0fb7dda1b8792409ad3d85688f767ffe38e227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Oudin?= Date: Sun, 25 Feb 2018 11:49:44 +0100 Subject: [PATCH] Better naming --- histories/models.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/histories/models.py b/histories/models.py index a0a8af7..7bcf5b2 100644 --- a/histories/models.py +++ b/histories/models.py @@ -68,18 +68,19 @@ def generate_partial_history(user, t_start): """ Generate the part of the history resulting from the crawl starting at the given url. """ + timestamp = t_start result = [] basis = generate_first_url(user) - result.append((basis, t_start)) - t_start += 5* random.weibullvariate(1, 1.5) + result.append((basis, timestamp)) + timestamp += 5* random.weibullvariate(1, 1.5) queue = Queue() crawler = crawl.CrawlingThread(user, basis, queue) crawler.start() crawler.join() urls = queue.get() for url in urls: - t_start += 5* random.weibullvariate(1, 1.5) - result.append((url, t_start) + timestamp += 5* random.weibullvariate(1, 1.5) + result.append((url, timestamp)) return result def generate_first_url(user):