Fix typos and remove unused import.
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by florentx · committed by florentx · parent 9f6bc93 · Browse files · 6 files·+15 added−14 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+15 added−14 removed
- other:+15 added−14 removed
Provenance
- Commit
3c821a0- Tree
646b91e- Author
florentx <florent.xicluna@gmail.com>- Committer
florentx <florent.xicluna@gmail.com>- Parent
9f6bc93
6 files changed+15 added−14 removed
modified:docs/patterns/jquery.rst+1 added-1 removed
109 unmodified lines110 111 Note that we are using the :meth:`~werkzeug.MultiDict.get` method here112 which will never fail. If the key is missing a default value (here ``0``)113 is returned. Furthermore it can convert values to a specific type (like114-in our case `int`). This is especially handy for code that that is114+in our case `int`). This is especially handy for code that is115 triggered by a script (APIs, JavaScript etc.) because you don't need116 special error reporting in that case.117 118 The HTML49 unmodified linesmodified:docs/patterns/packages.rst+2 added-3 removed
72 unmodified lines73 74 .. admonition:: Circular Imports75 76 Every Python programmer hates them, and yet we just added some:77- circular imports (That's when two module depend on each one. In this77+ circular imports (That's when two modules depend on each other. In this78 case `views.py` depends on `__init__.py`). Be advised that this is a79- bad idea in general but here it is actually fine. The reason for this80- is79+ bad idea in general but here it is actually fine. The reason for this is80 that we are not actually using the views in `__init__.py` and just81 ensuring the module is imported and we are doing that at the bottom of82 the file.83 3 unmodified linesmodified:docs/api.rst+1 added-1 removed
184 unmodified lines185 different values for each request. In a nutshell: it does the right186 thing, like it does for :class:`request` and :class:`session`.187 188 .. data:: g189- 189+190 Just store on this whatever you want. For example a database191 connection or the user that is currently logged in.192 193 69 unmodified linesmodified:examples/minitwit/minitwit.py+3 added-2 removed
123 unmodified lines124 followed = False125 if g.user:126 followed = query_db('''select 1 from follower where127 follower.who_id = ? and follower.whom_id = ?''',128- [session['user_id'], profile_user['user_id']], one=True) is not None128+ [session['user_id'], profile_user['user_id']],129+ one=True) is not None130 return render_template('timeline.html', messages=query_db('''131 select message.*, user.* from message, user where132 user.user_id = message.author_id and user.user_id = ?133 order by message.pub_date desc limit ?''',96 unmodified lines230 231 232 @app.route('/logout')233 def logout():233- """Logs the user out"""234+ """Logs the user out."""235 flash('You were logged out')236 session.pop('user_id', None)237 return redirect(url_for('public_timeline'))238 11 unmodified linesmodified:flask.py+4 added-5 removed
8 unmodified lines9 :copyright: (c) 2010 by Armin Ronacher.10 :license: BSD, see LICENSE for more details.11 """12 from __future__ import with_statement13-import re13 import os14 import sys15 16 from jinja2 import Environment, PackageLoader, FileSystemLoader242 unmodified lines259 )260 261 262 def _assert_have_json():264- """Helper function that fails if JSON is unavailable"""263+ """Helper function that fails if JSON is unavailable."""264 if not json_available:265 raise RuntimeError('simplejson not installed')266 267 247 unmodified lines515 session.save_cookie(response, self.session_cookie_name)516 517 def add_url_rule(self, rule, endpoint, view_func=None, **options):518 """Connects a URL rule. Works exactly like the :meth:`route`520- decorator. If a view_func is provided it will be registered with the519+ decorator. If a view_func is provided it will be registered with the520 endpoint.521 522 Basically this example::523 18 unmodified lines542 :param rule: the URL rule as string543 :param endpoint: the endpoint for the registered URL rule. Flask544 itself assumes the name of the view function as545 endpoint547- :param view_func: the function to call when servicing a request to the546+ :param view_func: the function to call when serving a request to the547 provided endpoint548 :param options: the options to be forwarded to the underlying549 :class:`~werkzeug.routing.Rule` object550 """245 unmodified lines796 """797 return self.request_context(create_environ(*args, **kwargs))798 799 def __call__(self, environ, start_response):801- """Shortcut for :attr:`wsgi_app`"""800+ """Shortcut for :attr:`wsgi_app`."""801 return self.wsgi_app(environ, start_response)802 803 804 # context locals5 unmodified linesmodified:setup.py+4 added-2 removed
32 unmodified lines33 `````34 35 * `website <http://flask.pocoo.org/>`_36 * `documentation <http://flask.pocoo.org/docs/>`_37+* `development version37-* `development version <http://github.com/mitsuhiko/flask/zipball/master#egg=Flask-dev>`_38+ <http://github.com/mitsuhiko/flask/zipball/master#egg=Flask-dev>`_39 40 """41 from setuptools import setup42 4 unmodified lines47 url='http://github.com/mitsuhiko/flask/',48 license='BSD',49 author='Armin Ronacher',50 author_email='armin.ronacher@active-4.com',50- description='A microframework based on Werkzeug, Jinja2 and good intentions',51+ description='A microframework based on Werkzeug, Jinja2 '52+ 'and good intentions',53 long_description=__doc__,54 py_modules=['flask'],55 zip_safe=False,56 platforms='any',15 unmodified lines