changeset 2923:f09bf7d9578e

fix E402 errors; imports not at top of file after installing pep8 1.6.1; partial fix for #492
author RogerHaase <haaserd@gmail.com>
date Sat, 21 Feb 2015 08:15:07 -0700
parents b99ff90c7fac
children 60116a78e932
files MoinMoin/apps/admin/views.py MoinMoin/apps/frontend/views.py MoinMoin/config/default.py MoinMoin/converter/html_out.py MoinMoin/converter/include.py MoinMoin/converter/moinwiki_in.py MoinMoin/converter/text_csv_in.py MoinMoin/items/__init__.py MoinMoin/items/content.py MoinMoin/themes/__init__.py setup.py
diffstat 11 files changed, 32 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/admin/views.py	Fri Feb 20 13:39:30 2015 -0700
+++ b/MoinMoin/apps/admin/views.py	Sat Feb 21 08:15:07 2015 -0700
@@ -29,6 +29,7 @@
 from MoinMoin.datastruct.backends import GroupDoesNotExistError
 from MoinMoin.items import Item
 from MoinMoin.util.interwiki import split_fqname
+from MoinMoin.config import default as defaultconfig
 
 
 @admin.route('/superuser')
@@ -112,9 +113,6 @@
     return redirect(url_for('.userbrowser'))
 
 
-from MoinMoin.config import default as defaultconfig
-
-
 @admin.route('/wikiconfig', methods=['GET', ])
 @require_permission(SUPERUSER)
 def wikiconfig():
--- a/MoinMoin/apps/frontend/views.py	Fri Feb 20 13:39:30 2015 -0700
+++ b/MoinMoin/apps/frontend/views.py	Sat Feb 21 08:15:07 2015 -0700
@@ -43,9 +43,6 @@
 from whoosh.analysis import StandardAnalyzer
 from whoosh import sorting
 
-from MoinMoin import log
-logging = log.getLogger(__name__)
-
 from MoinMoin.i18n import _, L_, N_
 from MoinMoin.themes import render_template, contenttype_to_class
 from MoinMoin.apps.frontend import frontend
@@ -69,6 +66,9 @@
 from MoinMoin.signalling import item_displayed, item_modified
 from MoinMoin.storage.middleware.protecting import AccessDenied
 
+from MoinMoin import log
+logging = log.getLogger(__name__)
+
 
 @frontend.route('/+dispatch', methods=['GET', ])
 def dispatch():
--- a/MoinMoin/config/default.py	Fri Feb 20 13:39:30 2015 -0700
+++ b/MoinMoin/config/default.py	Sat Feb 21 08:15:07 2015 -0700
@@ -16,9 +16,6 @@
 
 from babel import parse_locale
 
-from MoinMoin import log
-logging = log.getLogger(__name__)
-
 from MoinMoin.i18n import _, L_, N_
 from MoinMoin import error
 from MoinMoin.constants.rights import ACL_RIGHTS_CONTENTS, ACL_RIGHTS_FUNCTIONS
@@ -29,6 +26,9 @@
 from MoinMoin.util import plugins
 from MoinMoin.security import AccessControlList, DefaultSecurityPolicy
 
+from MoinMoin import log
+logging = log.getLogger(__name__)
+
 
 class CacheClass(object):
     """ just a container for stuff we cache """
--- a/MoinMoin/converter/html_out.py	Fri Feb 20 13:39:30 2015 -0700
+++ b/MoinMoin/converter/html_out.py	Sat Feb 21 08:15:07 2015 -0700
@@ -22,6 +22,9 @@
 from MoinMoin.util.tree import html, moin_page, xlink, xml, Name, xinclude
 from MoinMoin.constants.contenttypes import CONTENTTYPE_NONEXISTENT
 from MoinMoin.util.iri import Iri
+from MoinMoin.util.mime import Type, type_moin_document
+
+from . import default_registry
 
 from MoinMoin import log
 logging = log.getLogger(__name__)
@@ -817,6 +820,4 @@
     """
 
 
-from . import default_registry
-from MoinMoin.util.mime import Type, type_moin_document
 default_registry.register(ConverterPage._factory, type_moin_document, Type('application/x-xhtml-moin-page'))
--- a/MoinMoin/converter/include.py	Fri Feb 20 13:39:30 2015 -0700
+++ b/MoinMoin/converter/include.py	Sat Feb 21 08:15:07 2015 -0700
@@ -89,9 +89,6 @@
 import types
 import copy
 
-from MoinMoin import log
-logging = log.getLogger(__name__)
-
 from flask import current_app as app
 from flask import g as flaskg
 
@@ -107,6 +104,10 @@
 
 from ._args import Arguments
 
+from MoinMoin import log
+logging = log.getLogger(__name__)
+
+
 # elements generated by moin wiki markup that cannot have block children
 NO_BLOCK_CHILDREN = [
     'p',
--- a/MoinMoin/converter/moinwiki_in.py	Fri Feb 20 13:39:30 2015 -0700
+++ b/MoinMoin/converter/moinwiki_in.py	Sat Feb 21 08:15:07 2015 -0700
@@ -15,9 +15,6 @@
 
 from werkzeug import url_encode
 
-from MoinMoin import log
-logging = log.getLogger(__name__)
-
 from MoinMoin.constants.contenttypes import CHARSET
 from MoinMoin.constants.misc import URI_SCHEMES
 from MoinMoin.util.iri import Iri
@@ -30,6 +27,9 @@
 from ._wiki_macro import ConverterMacro
 from ._util import decode_data, normalize_split_text, _Iter, _Stack
 
+from MoinMoin import log
+logging = log.getLogger(__name__)
+
 
 class _TableArguments(object):
     rules = r'''
--- a/MoinMoin/converter/text_csv_in.py	Fri Feb 20 13:39:30 2015 -0700
+++ b/MoinMoin/converter/text_csv_in.py	Sat Feb 21 08:15:07 2015 -0700
@@ -15,6 +15,9 @@
 from MoinMoin.util.tree import moin_page
 from MoinMoin.i18n import _, L_, N_
 
+from . import default_registry
+from MoinMoin.util.mime import Type, type_moin_document
+
 
 class Converter(TableMixin):
     """
@@ -56,6 +59,4 @@
         return moin_page.page(children=(body, ))
 
 
-from . import default_registry
-from MoinMoin.util.mime import Type, type_moin_document
 default_registry.register(Converter._factory, Type('text/csv'), type_moin_document)
--- a/MoinMoin/items/__init__.py	Fri Feb 20 13:39:30 2015 -0700
+++ b/MoinMoin/items/__init__.py	Sat Feb 21 08:15:07 2015 -0700
@@ -35,9 +35,6 @@
 
 from MoinMoin.constants.contenttypes import CONTENTTYPES_HELP_DOCS
 
-from MoinMoin import log
-logging = log.getLogger(__name__)
-
 from MoinMoin.security.textcha import TextCha, TextChaizedForm
 from MoinMoin.signalling import item_modified
 from MoinMoin.storage.middleware.protecting import AccessDenied
@@ -63,6 +60,10 @@
 from MoinMoin.util.notifications import DESTROY_REV, DESTROY_ALL
 
 from .content import content_registry, Content, NonExistentContent, Draw
+from ..util.pysupport import load_package_modules
+
+from MoinMoin import log
+logging = log.getLogger(__name__)
 
 
 COLS = 80
@@ -965,5 +966,4 @@
         pass
 
 
-from ..util.pysupport import load_package_modules
 load_package_modules(__name__, __path__)
--- a/MoinMoin/items/content.py	Fri Feb 20 13:39:30 2015 -0700
+++ b/MoinMoin/items/content.py	Sat Feb 21 08:15:07 2015 -0700
@@ -47,9 +47,6 @@
 except ImportError:
     PIL = PILImage = PILdiff = None
 
-from MoinMoin import log
-logging = log.getLogger(__name__)
-
 from MoinMoin import wikiutil
 from MoinMoin.i18n import _, L_
 from MoinMoin.themes import render_template
@@ -73,6 +70,9 @@
 from MoinMoin.constants.keys import (NAME_EXACT, WIKINAME, CONTENTTYPE, SIZE, TAGS,
                                      HASH_ALGORITHM, ACTION_SAVE)
 
+from MoinMoin import log
+logging = log.getLogger(__name__)
+
 
 COLS = 80
 ROWS_DATA = 20
--- a/MoinMoin/themes/__init__.py	Fri Feb 20 13:39:30 2015 -0700
+++ b/MoinMoin/themes/__init__.py	Sat Feb 21 08:15:07 2015 -0700
@@ -17,9 +17,6 @@
 from flask import url_for, request
 from flask.ext.themes import get_theme, render_theme_template
 
-from MoinMoin import log
-logging = log.getLogger(__name__)
-
 from MoinMoin.i18n import _, L_, N_
 from MoinMoin import wikiutil, user
 from MoinMoin.constants.keys import USERID, ADDRESS, HOSTNAME, REVID, ITEMID, NAME_EXACT, ASSIGNED_TO
@@ -32,6 +29,9 @@
 from MoinMoin.util.clock import timed
 from MoinMoin.util.mime import Type
 
+from MoinMoin import log
+logging = log.getLogger(__name__)
+
 
 def get_current_theme():
     # this might be called at a time when flaskg.user is not setup yet:
--- a/setup.py	Fri Feb 20 13:39:30 2015 -0700
+++ b/setup.py	Sat Feb 21 08:15:07 2015 -0700
@@ -4,6 +4,8 @@
 # License: GNU GPL v2 (or any later version), see LICENSE.txt for details.
 
 import os
+from setuptools import setup, find_packages
+
 import MoinMoin  # validate python version
 
 
@@ -11,8 +13,6 @@
 with open(os.path.join(basedir, 'README.txt')) as f:
     long_description = f.read()
 
-from setuptools import setup, find_packages
-
 
 setup_args = dict(
     name="moin",