summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hellkamp <marc@gsites.de>2012-05-05 17:54:20 +0200
committerMarcel Hellkamp <marc@gsites.de>2012-05-29 16:07:48 +0200
commit59854c0c1d778f18089a51a53d6dfb15d0723130 (patch)
treeec5610772b265aaef18035d53112eb220105b537
parent5108c6bf2d0828d80953483450160dee8e88919a (diff)
downloadbottle-59854c0c1d778f18089a51a53d6dfb15d0723130.tar.gz
docs: Changelog and cleanup
-rw-r--r--bottle.py13
-rwxr-xr-xdocs/changelog.rst10
2 files changed, 16 insertions, 7 deletions
diff --git a/bottle.py b/bottle.py
index 539ed4e..77a9210 100644
--- a/bottle.py
+++ b/bottle.py
@@ -1250,21 +1250,20 @@ def _hkey(s):
class HeaderProperty(object):
def __init__(self, name, reader=None, writer=str, default=''):
- self.name, self.reader, self.writer, self.default = name, reader, writer, default
+ self.name, self.default = name, default
+ self.reader, self.writer = reader, writer
self.__doc__ = 'Current value of the %r header.' % name.title()
def __get__(self, obj, cls):
if obj is None: return self
- value = obj.headers.get(self.name)
- return self.reader(value) if (value and self.reader) else (value or self.default)
+ value = obj.headers.get(self.name, self.default)
+ return self.reader(value) if self.reader else value
def __set__(self, obj, value):
- if self.writer: value = self.writer(value)
- obj.headers[self.name] = value
+ obj.headers[self.name] = self.writer(value)
def __delete__(self, obj):
- if self.name in obj.headers:
- del obj.headers[self.name]
+ del obj.headers[self.name]
class BaseResponse(object):
diff --git a/docs/changelog.rst b/docs/changelog.rst
index 23e4fed..109aa8b 100755
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -13,6 +13,16 @@ Release 0.11
* Support for partial downloads (``Range`` header) in :func:`static_file`.
* Native support for Python 2.x and 3.x syntax. No need to run 2to3 anymore.
+.. rubric:: API Changes
+
+These APIs will most probably change in the next release.
+
+* :attr:`Response.status` is a read-write property that can be assigned either a numeric status code or a status string with a reason phrase (``200 OK``). The return value is now a string to better match existing APIs (WebOb, werkzeug). To be absolutely clear, you can use the read-only properties :attr:`BaseResponse.status_code` and :attr:`BaseResponse.status_line`.
+* :func:`run` is now a method of :class:`Bottle`. The module-level :func:`run` function still works and can be used further.
+* New :meth:`Bottle.merge` method to install all routes from one application into another.
+* New :attr:`BaseRequest.app` property to get the application object that handles that request.
+
+
Release 0.10
==============