Scrapy, a fast high-level web crawling & scraping framework for Python.
Add pretty-printting of settings as dict if using IPython shell
Paul Tremberth268e912273dc
diff --git a/scrapy/settings/__init__.py b/scrapy/settings/__init__.pyindex 918bfc1e5..7b7808959 100644--- a/scrapy/settings/__init__.py+++ b/scrapy/settings/__init__.py@@ -4,6 +4,7 @@ import copyimport warningsfrom collections import MutableMappingfrom importlib import import_module+from pprint import pformatfrom scrapy.utils.deprecate import create_deprecated_classfrom scrapy.exceptions import ScrapyDeprecationWarning@@ -388,6 +389,12 @@ class BaseSettings(MutableMapping):settings = self.copy()return settings._to_dict()+ def _repr_pretty_(self, p, cycle):+ if cycle:+ p.text(repr(self))+ else:+ p.text(pformat(self.copy_to_dict()))+@propertydef overrides(self):warnings.warn("`Settings.overrides` attribute is deprecated and won't "