diff --git a/doc/source/_static/tweaks.css b/doc/source/_static/tweaks.css index 16cd6e76e2..1b6fdaa186 100644 --- a/doc/source/_static/tweaks.css +++ b/doc/source/_static/tweaks.css @@ -62,4 +62,151 @@ table.docutils { a tt { color:#CF2F19; -} \ No newline at end of file +} + +/* ------------------------------------------ +PURE CSS SPEECH BUBBLES +by Nicolas Gallagher +- http://nicolasgallagher.com/pure-css-speech-bubbles/ + +http://nicolasgallagher.com +http://twitter.com/necolas + +Created: 02 March 2010 +Version: 1.1 (21 October 2010) + +Dual licensed under MIT and GNU GPLv2 © Nicolas Gallagher +------------------------------------------ */ +/* THE SPEECH BUBBLE +------------------------------------------------------------------------------------------------------------------------------- */ + +/* THE SPEECH BUBBLE +------------------------------------------------------------------------------------------------------------------------------- */ + +.triangle-border { + position:relative; + padding:15px; + margin:1em 0 3em; + border:5px solid #BC1518; + color:#333; + background:#fff; + + /* css3 */ + -moz-border-radius:10px; + -webkit-border-radius:10px; + border-radius:10px; +} + +/* Variant : for left positioned triangle +------------------------------------------ */ + +.triangle-border.left { + margin-left:30px; +} + +/* Variant : for right positioned triangle +------------------------------------------ */ + +.triangle-border.right { + margin-right:30px; +} + +/* THE TRIANGLE +------------------------------------------------------------------------------------------------------------------------------- */ + +.triangle-border:before { + content:""; + display:block; /* reduce the damage in FF3.0 */ + position:absolute; + bottom:-40px; /* value = - border-top-width - border-bottom-width */ + left:40px; /* controls horizontal position */ + width:0; + height:0; + border:20px solid transparent; + border-top-color:#BC1518; +} + +/* creates the smaller triangle */ +.triangle-border:after { + content:""; + display:block; /* reduce the damage in FF3.0 */ + position:absolute; + bottom:-26px; /* value = - border-top-width - border-bottom-width */ + left:47px; /* value = (:before left) + (:before border-left) - (:after border-left) */ + width:0; + height:0; + border:13px solid transparent; + border-top-color:#fff; +} + +/* Variant : top +------------------------------------------ */ + +/* creates the larger triangle */ +.triangle-border.top:before { + top:-40px; /* value = - border-top-width - border-bottom-width */ + right:40px; /* controls horizontal position */ + bottom:auto; + left:auto; + border:20px solid transparent; + border-bottom-color:#BC1518; +} + +/* creates the smaller triangle */ +.triangle-border.top:after { + top:-26px; /* value = - border-top-width - border-bottom-width */ + right:47px; /* value = (:before right) + (:before border-right) - (:after border-right) */ + bottom:auto; + left:auto; + border:13px solid transparent; + border-bottom-color:#fff; +} + +/* Variant : left +------------------------------------------ */ + +/* creates the larger triangle */ +.triangle-border.left:before { + top:10px; /* controls vertical position */ + left:-30px; /* value = - border-left-width - border-right-width */ + bottom:auto; + border-width:15px 30px 15px 0; + border-style:solid; + border-color:transparent #BC1518; +} + +/* creates the smaller triangle */ +.triangle-border.left:after { + top:16px; /* value = (:before top) + (:before border-top) - (:after border-top) */ + left:-21px; /* value = - border-left-width - border-right-width */ + bottom:auto; + border-width:9px 21px 9px 0; + border-style:solid; + border-color:transparent #fff; +} + +/* Variant : right +------------------------------------------ */ + +/* creates the larger triangle */ +.triangle-border.right:before { + top:10px; /* controls vertical position */ + right:-30px; /* value = - border-left-width - border-right-width */ + bottom:auto; + left:auto; + border-width:15px 0 15px 30px; + border-style:solid; + border-color:transparent #BC1518; +} + +/* creates the smaller triangle */ +.triangle-border.right:after { + top:16px; /* value = (:before top) + (:before border-top) - (:after border-top) */ + right:-21px; /* value = - border-left-width - border-right-width */ + bottom:auto; + left:auto; + border-width:9px 0 9px 21px; + border-style:solid; + border-color:transparent #fff; +} + diff --git a/doc/source/_theme/layout.html b/doc/source/_theme/layout.html index ed1cab0a6e..f0573a3b43 100644 --- a/doc/source/_theme/layout.html +++ b/doc/source/_theme/layout.html @@ -1,2 +1,69 @@ {% extends "sphinxdoc/layout.html" %} {% set css_files = css_files + ['_static/tweaks.css'] %} + +{%- macro sidebar() %} +{%- if not embedded %}{% if not theme_nosidebar|tobool %} +
+ {%- endif %}{% endif %} +{%- endmacro %} \ No newline at end of file diff --git a/doc/source/conf.py b/doc/source/conf.py index 88bc171e66..d03d956b9a 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -60,7 +60,7 @@ master_doc = 'index' # General information about the project. project = u'Swift' -copyright = u'2010, OpenStack, LLC' +copyright = u'2011, OpenStack, LLC' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -220,5 +220,6 @@ latex_documents = [ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'python': ('http://docs.python.org/', None), - 'nova': ('http://nova.openstack.org', None)} + 'nova': ('http://nova.openstack.org', None), + 'glance': ('http://glance.openstack.org', None)} diff --git a/doc/source/howto_cyberduck.rst b/doc/source/howto_cyberduck.rst index e9de135ff3..7fdf9ea630 100644 --- a/doc/source/howto_cyberduck.rst +++ b/doc/source/howto_cyberduck.rst @@ -48,7 +48,7 @@ Talking to Swift with Cyberduck #. Go to "Open Connection", select Rackspace Cloud Files, and connect. - .. image:: howto_cyberduck_config.png + .. image:: images/howto_cyberduck_config.png #. If you get SSL errors, make sure your auth and proxy server are both setup for SSL. If you get certificate errors (specifically, 'unable to find valid diff --git a/doc/source/howto_cyberduck_config.png b/doc/source/images/howto_cyberduck_config.png similarity index 100% rename from doc/source/howto_cyberduck_config.png rename to doc/source/images/howto_cyberduck_config.png diff --git a/swift/account/server.py b/swift/account/server.py index f15ac38c11..54f13177f5 100644 --- a/swift/account/server.py +++ b/swift/account/server.py @@ -261,7 +261,7 @@ class AccountController(object): if self.mount_check and not check_mount(self.root, drive): return Response(status='507 %s is not mounted' % drive) try: - args = simplejson.load(req.body_file) + args = simplejson.load(req.environ['wsgi.input']) except ValueError, err: return HTTPBadRequest(body=str(err), content_type='text/plain') ret = self.replicator_rpc.dispatch(post_args, args) diff --git a/swift/container/server.py b/swift/container/server.py index 3601594afc..3ced13d61f 100644 --- a/swift/container/server.py +++ b/swift/container/server.py @@ -349,7 +349,7 @@ class ContainerController(object): if self.mount_check and not check_mount(self.root, drive): return Response(status='507 %s is not mounted' % drive) try: - args = simplejson.load(req.body_file) + args = simplejson.load(req.environ['wsgi.input']) except ValueError, err: return HTTPBadRequest(body=str(err), content_type='text/plain') ret = self.replicator_rpc.dispatch(post_args, args) diff --git a/swift/obj/server.py b/swift/obj/server.py index 9e95ec7c6f..7d4b433a01 100644 --- a/swift/obj/server.py +++ b/swift/obj/server.py @@ -383,8 +383,8 @@ class ObjectController(object): with file.mkstemp() as (fd, tmppath): if 'content-length' in request.headers: fallocate(fd, int(request.headers['content-length'])) - for chunk in iter(lambda: request.body_file.read( - self.network_chunk_size), ''): + reader = request.environ['wsgi.input'].read + for chunk in iter(lambda: reader(self.network_chunk_size), ''): upload_size += len(chunk) if time.time() > upload_expiration: return HTTPRequestTimeout(request=request) diff --git a/swift/proxy/server.py b/swift/proxy/server.py index 0a0991c517..cdb6b335db 100644 --- a/swift/proxy/server.py +++ b/swift/proxy/server.py @@ -929,8 +929,8 @@ class ObjectController(Controller): error_response = check_object_creation(req, self.object_name) if error_response: return error_response - data_source = \ - iter(lambda: req.body_file.read(self.app.client_chunk_size), '') + reader = req.environ['wsgi.input'].read + data_source = iter(lambda: reader(self.app.client_chunk_size), '') source_header = req.headers.get('X-Copy-From') if source_header: source_header = unquote(source_header) diff --git a/test/unit/proxy/test_server.py b/test/unit/proxy/test_server.py index babcf99eca..782a31d2c5 100644 --- a/test/unit/proxy/test_server.py +++ b/test/unit/proxy/test_server.py @@ -835,9 +835,9 @@ class TestObjectController(unittest.TestCase): def test_status_map(statuses, expected): self.app.memcache.store = {} proxy_server.http_connect = mock_http_connect(*statuses) - req = Request.blank('/a/c/o.jpg', {}) + req = Request.blank('/a/c/o.jpg', + environ={'REQUEST_METHOD': 'PUT'}, body='some data') self.app.update_request(req) - req.body_file = StringIO('some data') res = controller.PUT(req) expected = str(expected) self.assertEquals(res.status[:len(expected)], expected)