Skip to content
Myr

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

6 files+15 added−14 removed

modified:docs/patterns/jquery.rst+1 added-1 removed
109 unmodified lines
110111Note that we are using the :meth:`~werkzeug.MultiDict.get` method here112which will never fail. If the key is missing a default value (here ``0``)113is returned. Furthermore it can convert values to a specific type (like114in our case `int`). This is especially handy for code that that is114in our case `int`). This is especially handy for code that is115triggered by a script (APIs, JavaScript etc.) because you don't need116special error reporting in that case.117118The HTML
49 unmodified lines
modified:docs/patterns/packages.rst+2 added-3 removed
72 unmodified lines
7374.. admonition:: Circular Imports7576 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 lines
modified:docs/api.rst+1 added-1 removed
184 unmodified lines
185different values for each request. In a nutshell: it does the right186thing, like it does for :class:`request` and :class:`session`.187188.. data:: g189 189190 Just store on this whatever you want. For example a database191 connection or the user that is currently logged in.192193
69 unmodified lines
modified:examples/minitwit/minitwit.py+3 added-2 removed
123 unmodified lines
124 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 lines
230231232@app.route('/logout')233def 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 lines
modified:flask.py+4 added-5 removed
8 unmodified lines
9 :copyright: (c) 2010 by Armin Ronacher.10 :license: BSD, see LICENSE for more details.11"""12from __future__ import with_statement13import re13import os14import sys1516from jinja2 import Environment, PackageLoader, FileSystemLoader
242 unmodified lines
259 )260261262def _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')266267
247 unmodified lines
515 session.save_cookie(response, self.session_cookie_name)516517 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.521522 Basically this example::523
18 unmodified lines
542 :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 lines
796 """797 return self.request_context(create_environ(*args, **kwargs))798799 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)802803804# context locals
5 unmodified lines
modified:setup.py+4 added-2 removed
32 unmodified lines
33`````3435* `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>`_3940"""41from setuptools import setup42
4 unmodified lines
47 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