mirror of https://github.com/scrapy/scrapy.git
Cleanup settings._DictProxy and scrapy.telnet (#5730)
This commit is contained in:
parent
04a1a4b730
commit
f6e9e6592a
|
|
@ -435,30 +435,6 @@ class BaseSettings(MutableMapping):
|
|||
p.text(pformat(self.copy_to_dict()))
|
||||
|
||||
|
||||
class _DictProxy(MutableMapping):
|
||||
|
||||
def __init__(self, settings, priority):
|
||||
self.o = {}
|
||||
self.settings = settings
|
||||
self.priority = priority
|
||||
|
||||
def __len__(self):
|
||||
return len(self.o)
|
||||
|
||||
def __getitem__(self, k):
|
||||
return self.o[k]
|
||||
|
||||
def __setitem__(self, k, v):
|
||||
self.settings.set(k, v, priority=self.priority)
|
||||
self.o[k] = v
|
||||
|
||||
def __delitem__(self, k):
|
||||
del self.o[k]
|
||||
|
||||
def __iter__(self, k, v):
|
||||
return iter(self.o)
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
"""
|
||||
This object stores Scrapy settings for the configuration of internal
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
import warnings
|
||||
import inspect
|
||||
from typing import List, Tuple
|
||||
from scrapy.exceptions import ScrapyDeprecationWarning
|
||||
|
||||
|
||||
|
|
@ -126,9 +127,7 @@ def _clspath(cls, forced=None):
|
|||
return f'{cls.__module__}.{cls.__name__}'
|
||||
|
||||
|
||||
DEPRECATION_RULES = [
|
||||
('scrapy.telnet.', 'scrapy.extensions.telnet.'),
|
||||
]
|
||||
DEPRECATION_RULES: List[Tuple[str, str]] = []
|
||||
|
||||
|
||||
def update_classpath(path):
|
||||
|
|
|
|||
Loading…
Reference in New Issue