Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added LICENSE.txt and AUTHORS.txt

  • Loading branch information...
commit dfac26ab13118935ef8c362d82ce123221b04ea4 1 parent 689b94f
moraes authored
View
27 AUTHORS.txt
@@ -0,0 +1,27 @@
+Tipfy is developed by Rodrigo Moraes <rodrigo.moraesgmail.com>.
+
+Tipfy includes open source libraries or code from the following projects:
+
+- `Werkzeug <http://werkzeug.pocoo.org/>`_
+ Copyright (c) 2009 by the Werkzeug Team
+ license: BSD
+
+- `Jinja2 <http://jinja.pocoo.org/2/>`_
+ Copyright (c) 2009 by the Jinja Team.
+ license: BSD
+
+- `Babel <http://babel.edgewall.org/>`_
+ Copyright (c) 2007-2008 Edgewall Software
+ license: BSD
+
+- `simplejson <http://undefined.org/python/#simplejson>`_
+ Copyright (c) 2006 Bob Ippolito
+ license: MIT
+
+- `Kay <http://code.google.com/p/kay-framework/>`_
+ Copyright (c) 2009 Accense Technology, Inc. All rights reserved.
+ license: BSD
+
+- `Zine <http://zine.pocoo.org/>`_
+ Copyright (c) 2009 by the Zine Team.
+ license: BSD
View
31 LICENSE.txt
@@ -0,0 +1,31 @@
+Copyright (c) 2009 by the Tipfy Team, see AUTHORS.txt for more details.
+
+Some rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
+ * The names of the contributors may not be used to endorse or
+ promote products derived from this software without specific
+ prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View
15 source/lib/werkzeug/debug/console.py
@@ -32,6 +32,12 @@ def isatty(self):
def close(self):
pass
+ def flush(self):
+ pass
+
+ def seek(self, n, mode=0):
+ pass
+
def reset(self):
val = ''.join(self._buffer)
del self._buffer[:]
@@ -48,12 +54,19 @@ def write(self, x):
def writelines(self, x):
self._write(escape(''.join(x)))
+ def readline(self):
+ if len(self._buffer) == 0:
+ return ''
+ ret = self._buffer[0]
+ del self._buffer[0]
+ return ret
+
class ThreadedStream(object):
"""Thread-local wrapper for sys.stdout for the interactive console."""
def push():
- if sys.stdout is sys.__stdout__:
+ if not isinstance(sys.stdout, ThreadedStream):
sys.stdout = ThreadedStream()
_local.stream = HTMLStringO()
push = staticmethod(push)
View
21 source/tipfy/app.py
@@ -63,6 +63,9 @@
ALLOWED_METHODS = frozenset(['get', 'post', 'head', 'options', 'put', 'delete',
'trace'])
+# Store application debugger in development.
+_debugged_app = None
+
class RequestHandler(object):
"""Base request handler. Only implements the minimal interface required by
@@ -194,6 +197,15 @@ def empty(self):
self.redirect_to, handler=self.handler)
+class PatchedCGIHandler(CGIHandler):
+ """wsgiref.handlers.CGIHandler holds os.environ when imported. This class
+ override this behaviour. Thanks to Kay framework for this patch.
+ """
+ def __init__(self):
+ self.os_environ = {}
+ CGIHandler.__init__(self)
+
+
def get_urls():
"""Returns the url rules for the app. Rules are cached in production only,
and are updated when new versions are deployed.
@@ -212,12 +224,15 @@ def get_urls():
def set_debugger(app):
"""Adds Werkzeug's pretty debugger screen, via monkeypatch. This only works
- in the dev server.
+ in the development server.
"""
+ global _debugged_app
import tipfy.utils.debug
sys.modules['werkzeug.debug.utils'] = tipfy.utils.debug
from werkzeug import DebuggedApplication
- return DebuggedApplication(app, evalex=True)
+ if _debugged_app is None:
+ _debugged_app = DebuggedApplication(app, evalex=True)
+ return _debugged_app
def make_wsgi_app():
@@ -237,7 +252,7 @@ def make_wsgi_app():
def run_wsgi_app(app):
"""Executes the WSGIApplication as a CGI script."""
- CGIHandler().run(app)
+ PatchedCGIHandler().run(app)
def get_wsgi_app():
Please sign in to comment.
Something went wrong with that request. Please try again.