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 /debug_toolbar/toolbar.py | |
| parent | a8a98ddde93d1427d2c431cb3f0b18cdfe87616a (diff) | |
| download | django-debug-toolbar-e7692b33ca7fd3f7704d283d6b1368cdea198d59.tar.bz2 | |
Rename storage to store to avoid conflicting with Django terminology.
Diffstat (limited to 'debug_toolbar/toolbar.py')
| -rw-r--r-- | debug_toolbar/toolbar.py | 16 | 
1 files changed, 8 insertions, 8 deletions
| 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. | 
