{"action":"created","comment":{"url":"https://api.github.com/repos/scrapy/scrapy/pulls/comments/32631651","id":32631651,"diff_hunk":"@@ -88,19 +103,48 @@ def getdict(self, name, default=None):\n             value = json.loads(value)\n         return dict(value)\n \n+    def _getcomposite(self, name):\n+        # DO NOT USE THIS FUNCTION IN YOUR CUSTOM PROJECTS\n+        # It's for internal use in the transition away from the _BASE settings and\n+        # will be removed along with _BASE support in a future release\n+        basename = name + \"_BASE\"\n+        if basename in self.attributes:\n+            warnings.warn('_BASE settings are deprecated.',\n+                          category=ScrapyDeprecationWarning)\n+            compsett = BaseSettings(self[name + \"_BASE\"], priority='default')\n+            compsett.update(self.get(name))","path":"scrapy/settings/__init__.py","position":88,"original_position":88,"commit_id":"9dac27510b96be6f0f0cf51b659767787ce8e938","original_commit_id":"b789d69874809d8d5c22789c6e9d6f60023d57b6","user":{"login":"jdemaeyer","id":10531844,"avatar_url":"https://avatars.githubusercontent.com/u/10531844?v=3","gravatar_id":"","url":"https://api.github.com/users/jdemaeyer","html_url":"https://github.com/jdemaeyer","followers_url":"https://api.github.com/users/jdemaeyer/followers","following_url":"https://api.github.com/users/jdemaeyer/following{/other_user}","gists_url":"https://api.github.com/users/jdemaeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/jdemaeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdemaeyer/subscriptions","organizations_url":"https://api.github.com/users/jdemaeyer/orgs","repos_url":"https://api.github.com/users/jdemaeyer/repos","events_url":"https://api.github.com/users/jdemaeyer/events{/privacy}","received_events_url":"https://api.github.com/users/jdemaeyer/received_events","type":"User","site_admin":false},"body":"True. I forgot that `__getitem__()` doesn't throw `KeyError`s either. I like all your nitpicks ;)","created_at":"2015-06-17T14:24:14Z","updated_at":"2015-06-17T14:24:14Z","html_url":"https://github.com/scrapy/scrapy/pull/1149#discussion_r32631651","pull_request_url":"https://api.github.com/repos/scrapy/scrapy/pulls/1149","_links":{"self":{"href":"https://api.github.com/repos/scrapy/scrapy/pulls/comments/32631651"},"html":{"href":"https://github.com/scrapy/scrapy/pull/1149#discussion_r32631651"},"pull_request":{"href":"https://api.github.com/repos/scrapy/scrapy/pulls/1149"}}},"pull_request":{"url":"https://api.github.com/repos/scrapy/scrapy/pulls/1149","id":33095018,"html_url":"https://github.com/scrapy/scrapy/pull/1149","diff_url":"https://github.com/scrapy/scrapy/pull/1149.diff","patch_url":"https://github.com/scrapy/scrapy/pull/1149.patch","issue_url":"https://api.github.com/repos/scrapy/scrapy/issues/1149","number":1149,"state":"open","locked":false,"title":"[WIP] Per-key priorities for dict-like settings by promoting dicts to Settings instances","user":{"login":"jdemaeyer","id":10531844,"avatar_url":"https://avatars.githubusercontent.com/u/10531844?v=3","gravatar_id":"","url":"https://api.github.com/users/jdemaeyer","html_url":"https://github.com/jdemaeyer","followers_url":"https://api.github.com/users/jdemaeyer/followers","following_url":"https://api.github.com/users/jdemaeyer/following{/other_user}","gists_url":"https://api.github.com/users/jdemaeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/jdemaeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdemaeyer/subscriptions","organizations_url":"https://api.github.com/users/jdemaeyer/orgs","repos_url":"https://api.github.com/users/jdemaeyer/repos","events_url":"https://api.github.com/users/jdemaeyer/events{/privacy}","received_events_url":"https://api.github.com/users/jdemaeyer/received_events","type":"User","site_admin":false},"body":"Expand settings priorities by assigning per-key priorities for the dict-like settings (e.g. `DOWNLOADER_MIDDLEWARES`), instead of just a single priority for the whole dictionary. This allows updating these settings from multiple locations without having to care (too much) about order. It is a prerequisite for the add-on system (#1272, #591).\r\n\r\nThere are two main updates:\r\n 1. All default dictionary settings are promoted to the `BaseSettings` class (formerly `Settings`). They behave just like dictionaries, but honour per-key priorities when being written to.\r\n 2. Since their rationale becomes obsolete with per-key priorities, all `X_BASE` settings are deprecated, with default entries now living in the `X` setting.\r\n\r\nAnd several smaller updates:\r\n 1. `Settings` is a subclass of `BaseSettings`. It loads the default settings and promotes dictionaries within them to `BaseSettings` instances.\r\n 2. `BaseSettings` has a complete dictionary-like interface.\r\n 3. *All* dictionary-like component/handler lists allow disabling components/handler by setting the value of a key/value pair to `None`. A new helper, `scrapy.util.remove_none_values()` was introduced for this. This was previously not supported by `FEED_STORAGES`, `FEED_EXPORTERS`, and `DEFAULT_REQUEST_HEADERS`.\r\n 4. The `scrapy.util.build_component_list()` helper has been updated according to the deprecation of `_BASE` settings, as the `(base, custom)` call signature does not make much sense anymore. It's still backwards-compatible.\r\n\r\nComes with many new/updated tests.","created_at":"2015-04-11T01:15:16Z","updated_at":"2015-06-17T14:24:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc6033aefeb52f26d8c37ee4e0c80f72a48d01db","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scrapy/scrapy/pulls/1149/commits","review_comments_url":"https://api.github.com/repos/scrapy/scrapy/pulls/1149/comments","review_comment_url":"https://api.github.com/repos/scrapy/scrapy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scrapy/scrapy/issues/1149/comments","statuses_url":"https://api.github.com/repos/scrapy/scrapy/statuses/9dac27510b96be6f0f0cf51b659767787ce8e938","head":{"label":"jdemaeyer:enhancement/settings-per-key-priorities","ref":"enhancement/settings-per-key-priorities","sha":"9dac27510b96be6f0f0cf51b659767787ce8e938","user":{"login":"jdemaeyer","id":10531844,"avatar_url":"https://avatars.githubusercontent.com/u/10531844?v=3","gravatar_id":"","url":"https://api.github.com/users/jdemaeyer","html_url":"https://github.com/jdemaeyer","followers_url":"https://api.github.com/users/jdemaeyer/followers","following_url":"https://api.github.com/users/jdemaeyer/following{/other_user}","gists_url":"https://api.github.com/users/jdemaeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/jdemaeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdemaeyer/subscriptions","organizations_url":"https://api.github.com/users/jdemaeyer/orgs","repos_url":"https://api.github.com/users/jdemaeyer/repos","events_url":"https://api.github.com/users/jdemaeyer/events{/privacy}","received_events_url":"https://api.github.com/users/jdemaeyer/received_events","type":"User","site_admin":false},"repo":{"id":32859911,"name":"scrapy","full_name":"jdemaeyer/scrapy","owner":{"login":"jdemaeyer","id":10531844,"avatar_url":"https://avatars.githubusercontent.com/u/10531844?v=3","gravatar_id":"","url":"https://api.github.com/users/jdemaeyer","html_url":"https://github.com/jdemaeyer","followers_url":"https://api.github.com/users/jdemaeyer/followers","following_url":"https://api.github.com/users/jdemaeyer/following{/other_user}","gists_url":"https://api.github.com/users/jdemaeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/jdemaeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdemaeyer/subscriptions","organizations_url":"https://api.github.com/users/jdemaeyer/orgs","repos_url":"https://api.github.com/users/jdemaeyer/repos","events_url":"https://api.github.com/users/jdemaeyer/events{/privacy}","received_events_url":"https://api.github.com/users/jdemaeyer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jdemaeyer/scrapy","description":"Scrapy, a fast high-level web crawling and screen scraping framework for Python.","fork":true,"url":"https://api.github.com/repos/jdemaeyer/scrapy","forks_url":"https://api.github.com/repos/jdemaeyer/scrapy/forks","keys_url":"https://api.github.com/repos/jdemaeyer/scrapy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jdemaeyer/scrapy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jdemaeyer/scrapy/teams","hooks_url":"https://api.github.com/repos/jdemaeyer/scrapy/hooks","issue_events_url":"https://api.github.com/repos/jdemaeyer/scrapy/issues/events{/number}","events_url":"https://api.github.com/repos/jdemaeyer/scrapy/events","assignees_url":"https://api.github.com/repos/jdemaeyer/scrapy/assignees{/user}","branches_url":"https://api.github.com/repos/jdemaeyer/scrapy/branches{/branch}","tags_url":"https://api.github.com/repos/jdemaeyer/scrapy/tags","blobs_url":"https://api.github.com/repos/jdemaeyer/scrapy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jdemaeyer/scrapy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jdemaeyer/scrapy/git/refs{/sha}","trees_url":"https://api.github.com/repos/jdemaeyer/scrapy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jdemaeyer/scrapy/statuses/{sha}","languages_url":"https://api.github.com/repos/jdemaeyer/scrapy/languages","stargazers_url":"https://api.github.com/repos/jdemaeyer/scrapy/stargazers","contributors_url":"https://api.github.com/repos/jdemaeyer/scrapy/contributors","subscribers_url":"https://api.github.com/repos/jdemaeyer/scrapy/subscribers","subscription_url":"https://api.github.com/repos/jdemaeyer/scrapy/subscription","commits_url":"https://api.github.com/repos/jdemaeyer/scrapy/commits{/sha}","git_commits_url":"https://api.github.com/repos/jdemaeyer/scrapy/git/commits{/sha}","comments_url":"https://api.github.com/repos/jdemaeyer/scrapy/comments{/number}","issue_comment_url":"https://api.github.com/repos/jdemaeyer/scrapy/issues/comments{/number}","contents_url":"https://api.github.com/repos/jdemaeyer/scrapy/contents/{+path}","compare_url":"https://api.github.com/repos/jdemaeyer/scrapy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jdemaeyer/scrapy/merges","archive_url":"https://api.github.com/repos/jdemaeyer/scrapy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jdemaeyer/scrapy/downloads","issues_url":"https://api.github.com/repos/jdemaeyer/scrapy/issues{/number}","pulls_url":"https://api.github.com/repos/jdemaeyer/scrapy/pulls{/number}","milestones_url":"https://api.github.com/repos/jdemaeyer/scrapy/milestones{/number}","notifications_url":"https://api.github.com/repos/jdemaeyer/scrapy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jdemaeyer/scrapy/labels{/name}","releases_url":"https://api.github.com/repos/jdemaeyer/scrapy/releases{/id}","created_at":"2015-03-25T11:16:59Z","updated_at":"2015-03-25T11:17:02Z","pushed_at":"2015-06-17T13:59:24Z","git_url":"git://github.com/jdemaeyer/scrapy.git","ssh_url":"git@github.com:jdemaeyer/scrapy.git","clone_url":"https://github.com/jdemaeyer/scrapy.git","svn_url":"https://github.com/jdemaeyer/scrapy","homepage":"http://scrapy.org","size":14304,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scrapy:master","ref":"master","sha":"47b1b748c25f2a5b13f0a9ffab09823f7e43e8b4","user":{"login":"scrapy","id":733635,"avatar_url":"https://avatars.githubusercontent.com/u/733635?v=3","gravatar_id":"","url":"https://api.github.com/users/scrapy","html_url":"https://github.com/scrapy","followers_url":"https://api.github.com/users/scrapy/followers","following_url":"https://api.github.com/users/scrapy/following{/other_user}","gists_url":"https://api.github.com/users/scrapy/gists{/gist_id}","starred_url":"https://api.github.com/users/scrapy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrapy/subscriptions","organizations_url":"https://api.github.com/users/scrapy/orgs","repos_url":"https://api.github.com/users/scrapy/repos","events_url":"https://api.github.com/users/scrapy/events{/privacy}","received_events_url":"https://api.github.com/users/scrapy/received_events","type":"Organization","site_admin":false},"repo":{"id":529502,"name":"scrapy","full_name":"scrapy/scrapy","owner":{"login":"scrapy","id":733635,"avatar_url":"https://avatars.githubusercontent.com/u/733635?v=3","gravatar_id":"","url":"https://api.github.com/users/scrapy","html_url":"https://github.com/scrapy","followers_url":"https://api.github.com/users/scrapy/followers","following_url":"https://api.github.com/users/scrapy/following{/other_user}","gists_url":"https://api.github.com/users/scrapy/gists{/gist_id}","starred_url":"https://api.github.com/users/scrapy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrapy/subscriptions","organizations_url":"https://api.github.com/users/scrapy/orgs","repos_url":"https://api.github.com/users/scrapy/repos","events_url":"https://api.github.com/users/scrapy/events{/privacy}","received_events_url":"https://api.github.com/users/scrapy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scrapy/scrapy","description":"Scrapy, a fast high-level web crawling & scraping framework for Python.","fork":false,"url":"https://api.github.com/repos/scrapy/scrapy","forks_url":"https://api.github.com/repos/scrapy/scrapy/forks","keys_url":"https://api.github.com/repos/scrapy/scrapy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scrapy/scrapy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scrapy/scrapy/teams","hooks_url":"https://api.github.com/repos/scrapy/scrapy/hooks","issue_events_url":"https://api.github.com/repos/scrapy/scrapy/issues/events{/number}","events_url":"https://api.github.com/repos/scrapy/scrapy/events","assignees_url":"https://api.github.com/repos/scrapy/scrapy/assignees{/user}","branches_url":"https://api.github.com/repos/scrapy/scrapy/branches{/branch}","tags_url":"https://api.github.com/repos/scrapy/scrapy/tags","blobs_url":"https://api.github.com/repos/scrapy/scrapy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scrapy/scrapy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scrapy/scrapy/git/refs{/sha}","trees_url":"https://api.github.com/repos/scrapy/scrapy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scrapy/scrapy/statuses/{sha}","languages_url":"https://api.github.com/repos/scrapy/scrapy/languages","stargazers_url":"https://api.github.com/repos/scrapy/scrapy/stargazers","contributors_url":"https://api.github.com/repos/scrapy/scrapy/contributors","subscribers_url":"https://api.github.com/repos/scrapy/scrapy/subscribers","subscription_url":"https://api.github.com/repos/scrapy/scrapy/subscription","commits_url":"https://api.github.com/repos/scrapy/scrapy/commits{/sha}","git_commits_url":"https://api.github.com/repos/scrapy/scrapy/git/commits{/sha}","comments_url":"https://api.github.com/repos/scrapy/scrapy/comments{/number}","issue_comment_url":"https://api.github.com/repos/scrapy/scrapy/issues/comments{/number}","contents_url":"https://api.github.com/repos/scrapy/scrapy/contents/{+path}","compare_url":"https://api.github.com/repos/scrapy/scrapy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scrapy/scrapy/merges","archive_url":"https://api.github.com/repos/scrapy/scrapy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scrapy/scrapy/downloads","issues_url":"https://api.github.com/repos/scrapy/scrapy/issues{/number}","pulls_url":"https://api.github.com/repos/scrapy/scrapy/pulls{/number}","milestones_url":"https://api.github.com/repos/scrapy/scrapy/milestones{/number}","notifications_url":"https://api.github.com/repos/scrapy/scrapy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scrapy/scrapy/labels{/name}","releases_url":"https://api.github.com/repos/scrapy/scrapy/releases{/id}","created_at":"2010-02-22T02:01:14Z","updated_at":"2015-06-17T11:41:43Z","pushed_at":"2015-06-17T13:59:28Z","git_url":"git://github.com/scrapy/scrapy.git","ssh_url":"git@github.com:scrapy/scrapy.git","clone_url":"https://github.com/scrapy/scrapy.git","svn_url":"https://github.com/scrapy/scrapy","homepage":"http://scrapy.org","size":26370,"stargazers_count":9024,"watchers_count":9024,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":2584,"mirror_url":null,"open_issues_count":256,"forks":2584,"open_issues":256,"watchers":9024,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scrapy/scrapy/pulls/1149"},"html":{"href":"https://github.com/scrapy/scrapy/pull/1149"},"issue":{"href":"https://api.github.com/repos/scrapy/scrapy/issues/1149"},"comments":{"href":"https://api.github.com/repos/scrapy/scrapy/issues/1149/comments"},"review_comments":{"href":"https://api.github.com/repos/scrapy/scrapy/pulls/1149/comments"},"review_comment":{"href":"https://api.github.com/repos/scrapy/scrapy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scrapy/scrapy/pulls/1149/commits"},"statuses":{"href":"https://api.github.com/repos/scrapy/scrapy/statuses/9dac27510b96be6f0f0cf51b659767787ce8e938"}}}}