{"action":"created","issue":{"url":"https://api.github.com/repos/Pylons/pyramid_debugtoolbar/issues/206","labels_url":"https://api.github.com/repos/Pylons/pyramid_debugtoolbar/issues/206/labels{/name}","comments_url":"https://api.github.com/repos/Pylons/pyramid_debugtoolbar/issues/206/comments","events_url":"https://api.github.com/repos/Pylons/pyramid_debugtoolbar/issues/206/events","html_url":"https://github.com/Pylons/pyramid_debugtoolbar/pull/206","id":52417081,"number":206,"title":"configurable request_history params","user":{"login":"jvanasco","id":204779,"avatar_url":"https://avatars.githubusercontent.com/u/204779?v=3","gravatar_id":"","url":"https://api.github.com/users/jvanasco","html_url":"https://github.com/jvanasco","followers_url":"https://api.github.com/users/jvanasco/followers","following_url":"https://api.github.com/users/jvanasco/following{/other_user}","gists_url":"https://api.github.com/users/jvanasco/gists{/gist_id}","starred_url":"https://api.github.com/users/jvanasco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvanasco/subscriptions","organizations_url":"https://api.github.com/users/jvanasco/orgs","repos_url":"https://api.github.com/users/jvanasco/repos","events_url":"https://api.github.com/users/jvanasco/events{/privacy}","received_events_url":"https://api.github.com/users/jvanasco/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-12-18T21:14:30Z","updated_at":"2015-01-05T18:18:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Pylons/pyramid_debugtoolbar/pulls/206","html_url":"https://github.com/Pylons/pyramid_debugtoolbar/pull/206","diff_url":"https://github.com/Pylons/pyramid_debugtoolbar/pull/206.diff","patch_url":"https://github.com/Pylons/pyramid_debugtoolbar/pull/206.patch"},"body":"This is regarding https://github.com/Pylons/pyramid_debugtoolbar/issues/205\r\n\r\nI have a few notes:\r\n\r\n1. I did some light housekeeping and alphabetized the imports and some settings in `__init__.py`; it was starting to get hard to understand what was/wasn't imported.\r\n\r\n2.  I added a new function to `utils` -- `get_application_registry`.  An issue I ran into, is that the actual settings are located in two distinct areas, depending on where you access the request.  \r\n\r\n* The setup routines are called by the \"end-user's\" application.  The settings are in `request.registry.settings`.\r\n* The view routines are called within a \"child\" application (i guess due to the toolbar being a separate item via `config.make_wsgi_app()`).  The settings are still located in the \"end-user's\" application, but this is now in `request.registry.parent_registry.settings`\r\n\r\nThe `button_style` in `request_view` was broken because of this (now fixed).\r\n\r\n3. I enabled ToolbarStorage to have a configurable default too.  All current requests to it specify the exact number, but there was a default already so i thought it should be configurable."},"comment":{"url":"https://api.github.com/repos/Pylons/pyramid_debugtoolbar/issues/comments/68750488","html_url":"https://github.com/Pylons/pyramid_debugtoolbar/pull/206#issuecomment-68750488","issue_url":"https://api.github.com/repos/Pylons/pyramid_debugtoolbar/issues/206","id":68750488,"user":{"login":"jvanasco","id":204779,"avatar_url":"https://avatars.githubusercontent.com/u/204779?v=3","gravatar_id":"","url":"https://api.github.com/users/jvanasco","html_url":"https://github.com/jvanasco","followers_url":"https://api.github.com/users/jvanasco/followers","following_url":"https://api.github.com/users/jvanasco/following{/other_user}","gists_url":"https://api.github.com/users/jvanasco/gists{/gist_id}","starred_url":"https://api.github.com/users/jvanasco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvanasco/subscriptions","organizations_url":"https://api.github.com/users/jvanasco/orgs","repos_url":"https://api.github.com/users/jvanasco/repos","events_url":"https://api.github.com/users/jvanasco/events{/privacy}","received_events_url":"https://api.github.com/users/jvanasco/received_events","type":"User","site_admin":false},"created_at":"2015-01-05T18:18:20Z","updated_at":"2015-01-05T18:18:20Z","body":"I integrated the requests.  Can rebase to squash the two commits into one, if that's better.\r\n\r\nThe big things to note:\r\n\r\n• we now need an `as_int` conversion for the default values of `max_request_history` & `max_visible_requests` in `__init__.py`.  This is handled by `utils.as_int, which just converts a string to int.\r\n\r\n• we also need to handle `None` as a conversion method for the default value of `button_style` in `__init__.py`.  (without being in the list of defaults, the setting won't be saved to the right registry).  This is handled by conditionally converting the `value` in the the nested `populate` def of `parse_settings`.  I also added a few docstrings to parse_settings and the lists of default_settings & default_transform for clarity.\r\n\r\n\r\n\r\n"}}