From 32abfcac8a8dd83a5a2e2d91b4e5f6ac54c1fa43 Mon Sep 17 00:00:00 2001 From: Noah Levitt Date: Wed, 8 Jul 2015 17:51:09 -0700 Subject: [PATCH] fix 'CrawlUrl' object has no attribute 'priority' bug --- umbra/frontier.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/umbra/frontier.py b/umbra/frontier.py index 52cdfe5..5a713c8 100644 --- a/umbra/frontier.py +++ b/umbra/frontier.py @@ -18,7 +18,7 @@ class CrawlUrl: self.priority_key = (priority << 32) | (hash(self.url) & (2**32 - 1)) def get_priority(self): - return self.priority >> 32 + return self.priority_key >> 32 @property def host(self): @@ -29,8 +29,8 @@ class CrawlUrl: class Frontier: def __init__(self): # {url:CrawlUrl} - self.urls = {} - + self.urls = {} + # {host:SortedDict{priority_key:CrawlUrl}} self.queues_by_host = {}