Error in the merge, mea culpa

This commit is contained in:
Rémi Oudin 2018-02-26 14:01:29 +01:00
parent db067e56fc
commit c4f63a92b2

View file

@ -6,7 +6,6 @@ interests, keywords...
from collections import namedtuple from collections import namedtuple
import random import random
from math import floor from math import floor
from queue import Queue
from xml.etree import ElementTree as ET from xml.etree import ElementTree as ET
from datetime import datetime from datetime import datetime
from django.db import models from django.db import models
@ -168,11 +167,11 @@ def generate_partial_history(user, t_start):
basis = generate_first_url(user) basis = generate_first_url(user)
result.append(PartialHistoryEntry(basis, timestamp)) result.append(PartialHistoryEntry(basis, timestamp))
t_start += 5 * random.weibullvariate(1, 1.5) t_start += 5 * random.weibullvariate(1, 1.5)
queue = Queue() output_tree = []
crawler = crawl.CrawlingThread(basis, queue) crawler = crawl.CrawlingThread(basis, output_tree)
crawler.start() crawler.start()
crawler.join() crawler.join()
urls = queue.get() urls = crawler.output_tree
for url in urls: for url in urls:
t_start += 5 * random.weibullvariate(1, 1.5) t_start += 5 * random.weibullvariate(1, 1.5)
result.append(PartialHistoryEntry(url, timestamp)) result.append(PartialHistoryEntry(url, timestamp))