Hello community,

here is the log from the commit of package python-bottle for openSUSE:Factory 
checked in at 2013-09-23 10:55:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-bottle (Old)
 and      /work/SRC/openSUSE:Factory/.python-bottle.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-bottle"

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-bottle/python-bottle.changes      
2012-11-25 13:27:20.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.python-bottle.new/python-bottle.changes 
2013-09-23 11:17:47.000000000 +0200
@@ -1,0 +2,9 @@
+Tue Sep 17 19:50:09 UTC 2013 - [email protected]
+
+- Update to 0.11.6:
+  * Fix content-type header in mounted apps
+- Changes from 0.11.5:
+  * Update HTTPResponse call when mounting apps
+  * BUg fix: Some cookies are lost when using mount()
+
+-------------------------------------------------------------------

Old:
----
  bottle-0.11.4.tar.gz

New:
----
  bottle-0.11.6.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-bottle.spec ++++++
--- /var/tmp/diff_new_pack.QPklJH/_old  2013-09-23 11:17:48.000000000 +0200
+++ /var/tmp/diff_new_pack.QPklJH/_new  2013-09-23 11:17:48.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           python-bottle
-Version:        0.11.4
+Version:        0.11.6
 Release:        0
 Url:            http://bottlepy.org/
 Summary:        Fast and simple WSGI-framework for small web-applications

++++++ bottle-0.11.4.tar.gz -> bottle-0.11.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bottle-0.11.4/PKG-INFO new/bottle-0.11.6/PKG-INFO
--- old/bottle-0.11.4/PKG-INFO  2012-11-21 17:05:28.000000000 +0100
+++ new/bottle-0.11.6/PKG-INFO  2013-02-01 20:25:52.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: bottle
-Version: 0.11.4
+Version: 0.11.6
 Summary: Fast and simple WSGI-framework for small web-applications.
 Home-page: http://bottlepy.org/
 Author: Marcel Hellkamp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bottle-0.11.4/bottle.py new/bottle-0.11.6/bottle.py
--- old/bottle-0.11.4/bottle.py 2012-11-21 17:05:12.000000000 +0100
+++ new/bottle-0.11.6/bottle.py 2013-02-01 20:25:48.000000000 +0100
@@ -16,7 +16,7 @@
 from __future__ import with_statement
 
 __author__ = 'Marcel Hellkamp'
-__version__ = '0.11.4'
+__version__ = '0.11.6'
 __license__ = 'MIT'
 
 # The gevent server adapter needs to patch some modules before they are 
imported
@@ -561,14 +561,15 @@
         def mountpoint_wrapper():
             try:
                 request.path_shift(path_depth)
-                rs = BaseResponse([], 200)
-                def start_response(status, header):
+                rs = HTTPResponse([])
+                def start_response(status, headerlist):
                     rs.status = status
-                    for name, value in header: rs.add_header(name, value)
+                    for name, value in headerlist: rs.add_header(name, value)
                     return rs.body.append
                 body = app(request.environ, start_response)
-                body = itertools.chain(rs.body, body)
-                return HTTPResponse(body, rs.status_code, rs.headers)
+                if body and rs.body: body = itertools.chain(rs.body, body)
+                rs.body = body or rs.body
+                return rs
             finally:
                 request.path_shift(-path_depth)
 
@@ -1285,7 +1286,7 @@
 
     def __init__(self, body='', status=None, **headers):
         self._cookies = None
-        self._headers = {'Content-Type': [self.default_content_type]}
+        self._headers = {}
         self.body = body
         self.status = status or self.default_status
         if headers:
@@ -1379,7 +1380,9 @@
     def headerlist(self):
         ''' WSGI conform list of (header, value) tuples. '''
         out = []
-        headers = self._headers.items()
+        headers = list(self._headers.items())
+        if 'Content-Type' not in self._headers:
+            headers.append(('Content-Type', [self.default_content_type]))
         if self._status_code in self.bad_headers:
             bad_headers = self.bad_headers[self._status_code]
             headers = [h for h in headers if h[0] not in bad_headers]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bottle-0.11.4/test/test_mount.py 
new/bottle-0.11.6/test/test_mount.py
--- old/bottle-0.11.4/test/test_mount.py        2012-10-17 22:49:31.000000000 
+0200
+++ new/bottle-0.11.6/test/test_mount.py        2013-02-01 20:25:48.000000000 
+0100
@@ -1,6 +1,6 @@
 import bottle
 from tools import ServerTestBase
-from bottle import Bottle
+from bottle import Bottle, response
 
 class TestAppMounting(ServerTestBase):
     def setUp(self):
@@ -61,7 +61,30 @@
         self.assertBody('WSGI /', '/test/')
         self.assertHeader('X-Test', 'WSGI', '/test/')
         self.assertBody('WSGI /test/bar', '/test/test/bar')
+            
+    def test_mount_wsgi(self):
+        @self.subapp.route('/cookie')
+        def test_cookie():
+            response.set_cookie('a', 'a')
+            response.set_cookie('b', 'b')
+        self.app.mount('/test', self.subapp)
+        c = self.urlopen('/test/cookie')['header']['Set-Cookie']
+        self.assertEqual(['a=a', 'b=b'], list(sorted(c.split(', '))))
+
+    def test_mount_wsgi_ctype_bug(self):
+        status = {}
+        def app(environ, start_response):
+            start_response('200 OK', [('Content-Type', 'test/test')])
+            return 'WSGI ' + environ['PATH_INFO']
+        self.app.mount('/test', app)
+        self.assertHeader('Content-Type', 'test/test', '/test/')
 
+    def test_mount_json_bug(self):
+        @self.subapp.route('/json')
+        def test_cookie():
+            return {'a':5}
+        self.app.mount('/test', self.subapp)
+        self.assertHeader('Content-Type', 'application/json', '/test/json')
 
 class TestAppMerging(ServerTestBase):
     def setUp(self):

++++++ bottle-docs.pdf ++++++
(binary differes)

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to