From 17a46a4d239a640049081b5cdcc1ff20ef63e38a Mon Sep 17 00:00:00 2001 From: Joel Perras Date: Wed, 14 Sep 2011 16:53:05 -0300 Subject: [PATCH 1/4] Fixed typo in docstring of `dispatch_request` method of `flask.views.View`. --- flask/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask/views.py b/flask/views.py index 2fe34622..60865cd4 100644 --- a/flask/views.py +++ b/flask/views.py @@ -64,7 +64,7 @@ class View(object): def dispatch_request(self): """Subclasses have to override this method to implement the - actual view functionc ode. This method is called with all + actual view function code. This method is called with all the arguments from the URL rule. """ raise NotImplementedError() From d4d6cc8401b94ab7c92b70ca5e5b21d22636dd5d Mon Sep 17 00:00:00 2001 From: Priit Laes Date: Sun, 18 Sep 2011 13:05:15 +0300 Subject: [PATCH 2/4] Clean up auditing command --- setup.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/setup.py b/setup.py index 5dfe3a87..255f1e77 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,7 @@ class run_audit(Command): user_options = [] def initialize_options(self): - all = None + pass def finalize_options(self): pass @@ -62,22 +62,19 @@ class run_audit(Command): print "Audit requires PyFlakes installed in your system.""" sys.exit(-1) - dirs = ['flask', 'tests'] - # Add example directories - for dir in ['flaskr', 'jqueryexample', 'minitwit']: - dirs.append(os.path.join('examples', dir)) - # TODO: Add test subdirectories warns = 0 + # Define top-level directories + dirs = ('flask', 'examples', 'scripts') for dir in dirs: - for filename in os.listdir(dir): - if filename.endswith('.py') and filename != '__init__.py': - warns += flakes.checkPath(os.path.join(dir, filename)) + for root, _, files in os.walk(dir): + for file in files: + if file != '__init__.py' and file.endswith('.py') : + warns += flakes.checkPath(os.path.join(root, file)) if warns > 0: print ("Audit finished with total %d warnings." % warns) else: print ("No problems found in sourcecode.") - setup( name='Flask', version='0.8-dev', From 907c24e6ffc436971d437b0b9122b840db9466d7 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Sat, 23 Jul 2011 11:32:59 -0700 Subject: [PATCH 3/4] Document the debug param for Flask.run, it is not part of **options given to run_simple. I am not sure bool() is appropriate. --- flask/app.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flask/app.py b/flask/app.py index 15f3ead2..4c8175d1 100644 --- a/flask/app.py +++ b/flask/app.py @@ -657,7 +657,7 @@ class Flask(_PackageBoundObject): # existing views. context.update(orig_ctx) - def run(self, host='127.0.0.1', port=5000, **options): + def run(self, host='127.0.0.1', port=5000, debug=None, **options): """Runs the application on a local development server. If the :attr:`debug` flag is set the server will automatically reload for code changes and show a debugger in case an exception happened. @@ -680,14 +680,15 @@ class Flask(_PackageBoundObject): :param host: the hostname to listen on. set this to ``'0.0.0.0'`` to have the server available externally as well. :param port: the port of the webserver + :param debug: if given, enable or disable debug mode. :param options: the options to be forwarded to the underlying Werkzeug server. See :func:`werkzeug.serving.run_simple` for more information. """ from werkzeug.serving import run_simple - if 'debug' in options: - self.debug = options.pop('debug') + if debug is not None: + self.debug = bool(debug) options.setdefault('use_reloader', self.debug) options.setdefault('use_debugger', self.debug) try: From 90884a78fbba4068fa93f87626baccd148cd4a57 Mon Sep 17 00:00:00 2001 From: Ron DuPlain Date: Sun, 18 Sep 2011 15:34:37 -0400 Subject: [PATCH 4/4] Cross-reference debug docs in run docstring. --- flask/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/flask/app.py b/flask/app.py index 4c8175d1..1ad669e3 100644 --- a/flask/app.py +++ b/flask/app.py @@ -681,6 +681,7 @@ class Flask(_PackageBoundObject): to have the server available externally as well. :param port: the port of the webserver :param debug: if given, enable or disable debug mode. + See :attr:`debug`. :param options: the options to be forwarded to the underlying Werkzeug server. See :func:`werkzeug.serving.run_simple` for more