diff options
| author | Aymeric Augustin | 2013-11-24 11:00:43 +0100 | 
|---|---|---|
| committer | Aymeric Augustin | 2013-11-24 11:01:44 +0100 | 
| commit | e7692b33ca7fd3f7704d283d6b1368cdea198d59 (patch) | |
| tree | 57d6954f16cd5b7b4b04331cf49eafc72e602137 | |
| parent | a8a98ddde93d1427d2c431cb3f0b18cdfe87616a (diff) | |
| download | django-debug-toolbar-e7692b33ca7fd3f7704d283d6b1368cdea198d59.tar.bz2 | |
Rename storage to store to avoid conflicting with Django terminology.
| -rw-r--r-- | debug_toolbar/static/debug_toolbar/js/toolbar.js | 6 | ||||
| -rw-r--r-- | debug_toolbar/templates/debug_toolbar/base.html | 4 | ||||
| -rw-r--r-- | debug_toolbar/toolbar.py | 16 | ||||
| -rw-r--r-- | debug_toolbar/views.py | 2 | ||||
| -rw-r--r-- | tests/test_integration.py | 2 | 
5 files changed, 15 insertions, 15 deletions
| diff --git a/debug_toolbar/static/debug_toolbar/js/toolbar.js b/debug_toolbar/static/debug_toolbar/js/toolbar.js index 3525f31..6b5dffd 100644 --- a/debug_toolbar/static/debug_toolbar/js/toolbar.js +++ b/debug_toolbar/static/debug_toolbar/js/toolbar.js @@ -27,12 +27,12 @@                  } else {                      $('.panelContent').hide(); // Hide any that are already open                      var inner = current.find('.djDebugPanelContent .scroll'), -                        storage_id = $('#djDebug').data('storage-id'), +                        store_id = $('#djDebug').data('store-id'),                          render_panel_url = $('#djDebug').data('render-panel-url'); -                    if (storage_id !== '' && inner.children().length === 0) { +                    if (store_id !== '' && inner.children().length === 0) {                          var ajax_data = {                              data: { -                                storage_id: storage_id, +                                store_id: store_id,                                  panel_id: this.className                              },                              type: 'GET', diff --git a/debug_toolbar/templates/debug_toolbar/base.html b/debug_toolbar/templates/debug_toolbar/base.html index 59e50a4..119e713 100644 --- a/debug_toolbar/templates/debug_toolbar/base.html +++ b/debug_toolbar/templates/debug_toolbar/base.html @@ -9,7 +9,7 @@ if(!window.jQuery) document.write('<scr'+'ipt src="//ajax.googleapis.com/ajax/li  <script src="{{ STATIC_URL }}debug_toolbar/js/jquery.cookie.js"></script>  <script src="{{ STATIC_URL }}debug_toolbar/js/toolbar.js"></script>  <div id="djDebug" style="display:none;" dir="ltr" -     data-storage-id="{{ toolbar.storage_id }}" data-render-panel-url="{% url 'djdt:render_panel' %}" +     data-store-id="{{ toolbar.store_id }}" data-render-panel-url="{% url 'djdt:render_panel' %}"       {{ toolbar.config.ROOT_TAG_ATTRS|safe }}>  	<div style="display:none;" id="djDebugToolbar">  		<ul id="djDebugPanelList"> @@ -53,7 +53,7 @@ if(!window.jQuery) document.write('<scr'+'ipt src="//ajax.googleapis.com/ajax/li  				</div>  				<div class="djDebugPanelContent">  					<div class="scroll"> -						{% if not toolbar.storage_id %}{{ panel.content }}{% endif %} +						{% if not toolbar.store_id %}{{ panel.content }}{% endif %}  					</div>  				</div>  			</div> diff --git a/debug_toolbar/toolbar.py b/debug_toolbar/toolbar.py index ca6d1b4..57ded5b 100644 --- a/debug_toolbar/toolbar.py +++ b/debug_toolbar/toolbar.py @@ -30,7 +30,7 @@ class DebugToolbar(object):              panel_instance = panel_class(self, context=self.template_context)              self._panels[panel_instance.panel_id] = panel_instance          self.stats = {} -        self.storage_id = None +        self.store_id = None      # Manage panels @@ -67,7 +67,7 @@ class DebugToolbar(object):      # Handle storing toolbars in memory and fetching them later on -    _storage = SortedDict() +    _store = SortedDict()      def should_render_panels(self):          render_panels = self.config['RENDER_PANELS'] @@ -76,17 +76,17 @@ class DebugToolbar(object):          return render_panels      def store(self): -        self.storage_id = uuid.uuid4().hex +        self.store_id = uuid.uuid4().hex          cls = type(self) -        cls._storage[self.storage_id] = self -        for _ in range(len(cls._storage) - self.config['RESULTS_CACHE_SIZE']): +        cls._store[self.store_id] = self +        for _ in range(len(cls._store) - self.config['RESULTS_CACHE_SIZE']):              # When we drop support for Python 2.6 and switch to              # collections.OrderedDict, use popitem(last=False). -            del cls._storage[cls._storage.keyOrder[0]] +            del cls._store[cls._store.keyOrder[0]]      @classmethod -    def fetch(cls, storage_id): -        return cls._storage.get(storage_id) +    def fetch(cls, store_id): +        return cls._store.get(store_id)      # Manually implement class-level caching of panel classes and url patterns      # because it's more obvious than going through an abstraction. diff --git a/debug_toolbar/views.py b/debug_toolbar/views.py index 109c87a..d46a74e 100644 --- a/debug_toolbar/views.py +++ b/debug_toolbar/views.py @@ -9,7 +9,7 @@ from debug_toolbar.toolbar import DebugToolbar  def render_panel(request):      """Render the contents of a panel""" -    toolbar = DebugToolbar.fetch(request.GET['storage_id']) +    toolbar = DebugToolbar.fetch(request.GET['store_id'])      if toolbar is None:          content = _("Data for this panel isn't available anymore. "                      "Please reload the page and retry.") diff --git a/tests/test_integration.py b/tests/test_integration.py index e92cab6..32fd09e 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -136,7 +136,7 @@ class DebugToolbarLiveTestCase(LiveServerTestCase):          self.assertIn("Version", table.text)      @override_settings(DEBUG_TOOLBAR_CONFIG={'RESULTS_CACHE_SIZE': 0}) -    def test_expired_storage(self): +    def test_expired_store(self):          self.selenium.get(self.live_server_url + '/regular/basic/')          version_panel = self.selenium.find_element_by_id('VersionsPanel') | 
