From e7692b33ca7fd3f7704d283d6b1368cdea198d59 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sun, 24 Nov 2013 11:00:43 +0100 Subject: Rename storage to store to avoid conflicting with Django terminology. --- debug_toolbar/static/debug_toolbar/js/toolbar.js | 6 +++--- debug_toolbar/templates/debug_toolbar/base.html | 4 ++-- debug_toolbar/toolbar.py | 16 ++++++++-------- debug_toolbar/views.py | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) (limited to 'debug_toolbar') 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(' 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.") -- cgit v1.2.3