Anonymous avatar Anonymous committed 3b4a7af

Documentation updates.

Comments (0)

Files changed (2)

 cleans up it will clean up all the data left in the locals for this
 context.
 
+.. autofunction:: release_local
+
 .. autoclass:: LocalManager
    :members: cleanup, make_middleware, middleware, get_ident
 
+.. autoclass:: LocalStack
+   :members: stack, push, pop, top
+
 .. autoclass:: LocalProxy
    :members: _get_current_object
 

werkzeug/local.py

 
     @property
     def stack(self):
+        """The current context's stack as list"""
         self._lock.acquire()
         try:
             rv = getattr(self._local, 'stack', None)
             self._lock.release()
 
     def push(self, obj):
+        """Pushes a new item to the stack"""
         self.stack.append(obj)
 
     def pop(self):
+        """Removes the topmost item from the stack, will return the
+        old value or `None` if the stack was already empty.
+        """
         try:
             return self.stack.pop()
         except IndexError:
 
     @property
     def top(self):
+        """The topmost item on the stack.  If the stack is empty,
+        `None` is returned.
+        """
         try:
             return self.stack[-1]
         except IndexError:
             raise RuntimeError('no object bound to %s' % self.__name__)
     __current_object = property(_get_current_object)
 
+    @property
     def __dict__(self):
         try:
             return self.__current_object.__dict__
         except RuntimeError:
             return AttributeError('__dict__')
-    __dict__ = property(__dict__)
 
     def __repr__(self):
         try:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.