From 7070dae48da02fa29aa1650af4df28561e343436 Mon Sep 17 00:00:00 2001 From: Mikhail Korobov Date: Tue, 26 Jan 2016 13:56:16 +0500 Subject: [PATCH 1/2] deprecate unused and untested scrapy.utils.datatypes.SiteNode --- scrapy/utils/datatypes.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scrapy/utils/datatypes.py b/scrapy/utils/datatypes.py index 097bd1ac9..2b54982b8 100644 --- a/scrapy/utils/datatypes.py +++ b/scrapy/utils/datatypes.py @@ -137,10 +137,18 @@ class MultiValueDict(dict): for key, value in six.iteritems(kwargs): self.setlistdefault(key, []).append(value) + class SiteNode(object): """Class to represent a site node (page, image or any other file)""" def __init__(self, url): + warnings.warn( + "scrapy.utils.datatypes.SiteNode is deprecated " + "and will be removed in future releases.", + category=ScrapyDeprecationWarning, + stacklevel=2 + ) + self.url = url self.itemnames = [] self.children = [] From 9c2aa50ea20d2333eb131c6aae7b9842d646e32e Mon Sep 17 00:00:00 2001 From: Mikhail Korobov Date: Tue, 26 Jan 2016 13:58:20 +0500 Subject: [PATCH 2/2] deprecate unused and untested scrapy.utils.datatypes.MultiValueDict --- scrapy/utils/datatypes.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/scrapy/utils/datatypes.py b/scrapy/utils/datatypes.py index 2b54982b8..d04b43176 100644 --- a/scrapy/utils/datatypes.py +++ b/scrapy/utils/datatypes.py @@ -7,11 +7,22 @@ This module must not depend on any module outside the Standard Library. import copy import six +import warnings from collections import OrderedDict +from scrapy.exceptions import ScrapyDeprecationWarning + class MultiValueDictKeyError(KeyError): - pass + def __init__(self, *args, **kwargs): + warnings.warn( + "scrapy.utils.datatypes.MultiValueDictKeyError is deprecated " + "and will be removed in future releases.", + category=ScrapyDeprecationWarning, + stacklevel=2 + ) + super(MultiValueDictKeyError, self).__init__(*args, **kwargs) + class MultiValueDict(dict): """ @@ -31,6 +42,10 @@ class MultiValueDict(dict): single name-value pairs. """ def __init__(self, key_to_list_mapping=()): + warnings.warn("scrapy.utils.datatypes.MultiValueDict is deprecated " + "and will be removed in future releases.", + category=ScrapyDeprecationWarning, + stacklevel=2) dict.__init__(self, key_to_list_mapping) def __repr__(self):