A stack-like list. Calling it returns the head of the stack.
| 1754 | |
| 1755 | |
| 1756 | class AppStack(list): |
| 1757 | """ A stack-like list. Calling it returns the head of the stack. """ |
| 1758 | |
| 1759 | def __call__(self): |
| 1760 | """ Return the current default application. """ |
| 1761 | return self[-1] |
| 1762 | |
| 1763 | def push(self, value=None): |
| 1764 | """ Add a new :class:`Bottle` instance to the stack """ |
| 1765 | if not isinstance(value, Bottle): |
| 1766 | value = Bottle() |
| 1767 | self.append(value) |
| 1768 | return value |
| 1769 | |
| 1770 | |
| 1771 | class WSGIFileWrapper(object): |