From cbab2ac7a4f0ff6c4521fe87d0baa3db3eae94c9 Mon Sep 17 00:00:00 2001 From: "Jip J. Dekker" Date: Sat, 7 Jun 2014 12:21:00 +0200 Subject: [PATCH] The difference between class and object variables --- FourmiCrawler/sources/NIST.py | 2 +- FourmiCrawler/spider.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/FourmiCrawler/sources/NIST.py b/FourmiCrawler/sources/NIST.py index 10496ab..3e061ae 100644 --- a/FourmiCrawler/sources/NIST.py +++ b/FourmiCrawler/sources/NIST.py @@ -22,11 +22,11 @@ class NIST(Source): search = 'cgi/cbook.cgi?Name=%s&Units=SI&cTP=on' - ignore_list = set() cfg = {} def __init__(self, config={}): Source.__init__(self, config) + self.ignore_list = set() self.cfg = config if 'reliability' not in self.cfg or self.cfg['reliability'] == '': log.msg('Reliability not set for NIST', level=log.WARNING) diff --git a/FourmiCrawler/spider.py b/FourmiCrawler/spider.py index 60f7363..5c09f07 100644 --- a/FourmiCrawler/spider.py +++ b/FourmiCrawler/spider.py @@ -9,8 +9,6 @@ class FourmiSpider(Spider): A spider writen for the Fourmi Project which calls upon all available sources to request and scrape data. """ name = "FourmiSpider" - _sources = [] - synonyms = set() def __init__(self, compound=None, selected_attributes=[".*"], *args, **kwargs): """ @@ -18,6 +16,8 @@ class FourmiSpider(Spider): :param compound: compound that will be searched. :param selected_attributes: A list of regular expressions that the attributes should match. """ + self._sources = [] + self.synonyms = set() super(FourmiSpider, self).__init__(*args, **kwargs) self.synonyms.add(compound) self.selected_attributes = selected_attributes