From b19a482d4750a0d9ffde080a18a82a840eeb914f Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Sat, 25 Feb 2017 13:47:11 +0900 Subject: [PATCH] Fix PEP-8 errors There are several instances of the error: E305 expected 2 blank lines after class or function definition Fix them all by adding the necessary blank lines. Change-Id: I37e2990772f05a100fe303c1512b7bdfb10a660d --- lodgeit/controllers/pastes.py | 1 + lodgeit/database.py | 2 ++ lodgeit/lib/highlighting.py | 1 + lodgeit/utils.py | 1 + manage.py | 2 ++ tests/utilities/runner.py | 1 + 6 files changed, 8 insertions(+) diff --git a/lodgeit/controllers/pastes.py b/lodgeit/controllers/pastes.py index 01728d2..43212f8 100644 --- a/lodgeit/controllers/pastes.py +++ b/lodgeit/controllers/pastes.py @@ -180,4 +180,5 @@ class PasteController(object): """Show a captcha.""" return Captcha().get_response(set_cookie=True) + controller = PasteController diff --git a/lodgeit/database.py b/lodgeit/database.py index a098693..f4d9e6f 100644 --- a/lodgeit/database.py +++ b/lodgeit/database.py @@ -24,6 +24,7 @@ def session_factory(): options = {'autoflush': True, 'autocommit': False} return orm.create_session(application.engine, **options) + session = orm.scoped_session(session_factory, scopefunc=_local_manager.get_ident) @@ -55,4 +56,5 @@ def _make_module(): db.NoResultFound = orm.exc.NoResultFound return db + sys.modules['lodgeit.database.db'] = db = _make_module() diff --git a/lodgeit/lib/highlighting.py b/lodgeit/lib/highlighting.py index b27cc75..ff088bc 100644 --- a/lodgeit/lib/highlighting.py +++ b/lodgeit/lib/highlighting.py @@ -38,6 +38,7 @@ def _get_pygments_lexers(add_empty=True): r.append((lexer[1][0], _(lexer[0])),) return r + LANGUAGES = _get_pygments_lexers() #: Add LodgeIt's special language lexers #: Or at least ensure those exist. diff --git a/lodgeit/utils.py b/lodgeit/utils.py index 3d03f28..f4e0bde 100644 --- a/lodgeit/utils.py +++ b/lodgeit/utils.py @@ -43,6 +43,7 @@ def url_for(endpoint, external=False, **values): builder = local.ctx.url_adapter.build return builder(endpoint, values, force_external=external) + jinja_environment.globals['url_for'] = url_for diff --git a/manage.py b/manage.py index 05a774b..8541705 100755 --- a/manage.py +++ b/manage.py @@ -15,10 +15,12 @@ def run_app(app, path='/'): env = create_environ(path, SECRET_KEY) return run_wsgi_app(app, env) + action_runserver = script.make_runserver( lambda: make_app(dburi, SECRET_KEY, debug=True), use_reloader=True) + action_shell = script.make_shell( lambda: { 'app': make_app(dburi, SECRET_KEY, False, True), diff --git a/tests/utilities/runner.py b/tests/utilities/runner.py index 0857940..c1e04f8 100644 --- a/tests/utilities/runner.py +++ b/tests/utilities/runner.py @@ -21,4 +21,5 @@ def testcase(): return with_setup(setup, teardown)(f) return dec + testcase.__test__ = False