From 1a7f579ece2528e73d9959d6fe4c8d7172fc3959 Mon Sep 17 00:00:00 2001 From: Aaron Kavlie Date: Mon, 14 Mar 2011 23:32:33 -0400 Subject: [PATCH 1/6] Improved botched docstring wording for silent failure. --- flask/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flask/config.py b/flask/config.py index b276f168..b588dfa1 100644 --- a/flask/config.py +++ b/flask/config.py @@ -89,7 +89,7 @@ class Config(dict): app.config.from_pyfile(os.environ['YOURAPPLICATION_SETTINGS']) :param variable_name: name of the environment variable - :param silent: set to `True` if you want silent to fail for missing + :param silent: set to `True` if you want silent failure for missing files. :return: bool. `True` if able to load config, `False` otherwise. """ @@ -113,7 +113,7 @@ class Config(dict): :param filename: the filename of the config. This can either be an absolute filename or a filename relative to the root path. - :param silent: set to `True` if you want silent to fail for missing + :param silent: set to `True` if you want silent failure for missing files. .. versionadded:: 0.7 From c6e4d743a93d8999a8d95044b6d89132e25cb7d9 Mon Sep 17 00:00:00 2001 From: Aaron Kavlie Date: Wed, 27 Apr 2011 14:28:07 -0700 Subject: [PATCH 2/6] A couple of corrections to the example fabfile. --- docs/patterns/fabric.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/patterns/fabric.rst b/docs/patterns/fabric.rst index 49be85ab..dbd4f913 100644 --- a/docs/patterns/fabric.rst +++ b/docs/patterns/fabric.rst @@ -32,7 +32,7 @@ hosts. These hosts can be defined either in the fabfile or on the command line. In this case we will add them to the fabfile. This is a basic first example that has the ability to upload the current -sourcecode to the server and install it into a already existing +sourcecode to the server and install it into a pre-existing virtual environment:: from fabric.api import * @@ -53,12 +53,12 @@ virtual environment:: put('dist/%s.tar.gz' % dist, '/tmp/yourapplication.tar.gz') # create a place where we can unzip the tarball, then enter # that directory and unzip it - run('mkdir yourapplication') + run('mkdir /tmp/yourapplication') with cd('/tmp/yourapplication'): run('tar xzf /tmp/yourapplication.tar.gz') - # now setup the package with our virtual environment's - # python interpreter - run('/var/www/yourapplication/env/bin/python setup.py install') + # now setup the package with our virtual environment's + # python interpreter + run('/var/www/yourapplication/env/bin/python setup.py install') # now that all is set up, delete the folder again run('rm -rf /tmp/yourapplication /tmp/yourapplication.tar.gz') # and finally touch the .wsgi file so that mod_wsgi triggers From 15c937b316b16b12df2375c706bcc93e3d37d33e Mon Sep 17 00:00:00 2001 From: Ron DuPlain Date: Sun, 1 May 2011 16:36:51 -0400 Subject: [PATCH 3/6] Remove ctx.bind() from doc. It doesn't exist. --- flask/app.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/flask/app.py b/flask/app.py index 20fa42d9..1e068e41 100644 --- a/flask/app.py +++ b/flask/app.py @@ -928,15 +928,6 @@ class Flask(_PackageBoundObject): finally: ctx.pop() - The big advantage of this approach is that you can use it without - the try/finally statement in a shell for interactive testing: - - >>> ctx = app.test_request_context() - >>> ctx.bind() - >>> request.path - u'/' - >>> ctx.unbind() - .. versionchanged:: 0.3 Added support for non-with statement usage and `with` statement is now passed the ctx object. From 74514fc83795d5ca705f67333993b5c7f9d01316 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Sun, 8 May 2011 11:31:52 +0200 Subject: [PATCH 4/6] the import order note was meant to be bold, not cursive --- docs/patterns/packages.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/patterns/packages.rst b/docs/patterns/packages.rst index e1b92c08..28cd70e4 100644 --- a/docs/patterns/packages.rst +++ b/docs/patterns/packages.rst @@ -57,7 +57,7 @@ following quick checklist: 2. all the view functions (the ones with a :meth:`~flask.Flask.route` decorator on top) have to be imported when in the `__init__.py` file. Not the object itself, but the module it is in. Import the view module - *after the application object is created*. + **after the application object is created**. Here's an example `__init__.py`:: From 8b974eb35523fde507055a27f70484133bb21b79 Mon Sep 17 00:00:00 2001 From: Ron DuPlain Date: Thu, 12 May 2011 12:54:56 -0400 Subject: [PATCH 5/6] Note to use debug=False for third-party debuggers. As requested on mailing list. http://flask.pocoo.org/mailinglist/archive/2011/5/12/using-eclipse%2Bpydev-for-debugging-flask-apps/ --- docs/quickstart.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index b4f6027f..c18c2332 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -113,6 +113,11 @@ Screenshot of the debugger in action: :class: screenshot :alt: screenshot of debugger in action +.. admonition:: Working With Other Debuggers + + Some third-party debuggers, e.g. PyDev and IntelliJ, are interrupted when + ``app`` reloads. To use these debuggers, set ``app.debug = False``. + Routing ------- From ea77d5e12d5148e8f42e449deac64f363c5db484 Mon Sep 17 00:00:00 2001 From: Ron DuPlain Date: Thu, 19 May 2011 09:14:53 -0400 Subject: [PATCH 6/6] Touch up docs according to user feedback. --- docs/quickstart.rst | 4 ++-- flask/config.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index c18c2332..fc5ae0f1 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -115,8 +115,8 @@ Screenshot of the debugger in action: .. admonition:: Working With Other Debuggers - Some third-party debuggers, e.g. PyDev and IntelliJ, are interrupted when - ``app`` reloads. To use these debuggers, set ``app.debug = False``. + Debuggers interfere with each other. If you are using another debugger + (e.g. PyDev or IntelliJ), you may need to set ``app.debug = False``. Routing diff --git a/flask/config.py b/flask/config.py index b588dfa1..bb2d6e9e 100644 --- a/flask/config.py +++ b/flask/config.py @@ -141,8 +141,8 @@ class Config(dict): Objects are usually either modules or classes. - Just the uppercase variables in that object are stored in the config - after lowercasing. Example usage:: + Just the uppercase variables in that object are stored in the config. + Example usage:: app.config.from_object('yourapplication.default_config') from yourapplication import default_config