]> git.phdru.name Git - m_librarian.git/commitdiff
Fix new flake8 E402: module level import not at top of file
authorOleg Broytman <phd@phdru.name>
Sun, 29 May 2016 15:54:52 +0000 (18:54 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 29 May 2016 15:54:52 +0000 (18:54 +0300)
m_librarian/config.py
m_librarian/db.py
m_librarian/glst.py
m_librarian/inp.py
m_librarian/search.py
setup.py
tests/__init__.py

index 3609d34666b3d99c3a9f18a332fbe4590737498a..04e64e0c9f99e8aa949e1500eb69d1e15b28bdae 100755 (executable)
@@ -1,10 +1,10 @@
 #! /usr/bin/env python
 
-__all__ = ['get_config']
-
 import os
 from ConfigParser import SafeConfigParser
 
+__all__ = ['get_config']
+
 
 def _find_config_dirs_posix():
     config_dirs = []
index 7e5744f243e64eabebe14afadd66f768a08e2430..b3ddd5211961196f282c411cfffe79acf9edada7 100755 (executable)
@@ -1,16 +1,16 @@
 #! /usr/bin/env python
 
-__all__ = ['Author', 'Book', 'Extension', 'Genre', 'Language',
-           'AuthorBook', 'BookGenre', 'open_db', 'init_db',
-           'insert_name', 'insert_author', 'update_counters',
-           ]
-
 import os
 from sqlobject import SQLObject, StringCol, UnicodeCol, IntCol, BoolCol, \
     ForeignKey, DateCol, DatabaseIndex, RelatedJoin, \
     connectionForURI, sqlhub, SQLObjectNotFound, dberrors
 from .config import get_config
 
+__all__ = ['Author', 'Book', 'Extension', 'Genre', 'Language',
+           'AuthorBook', 'BookGenre', 'open_db', 'init_db',
+           'insert_name', 'insert_author', 'update_counters',
+           ]
+
 
 class Author(SQLObject):
     surname = UnicodeCol(notNull=True)
index 2de36c3a92180b7abaf1b7b76079e51938e93c06..a4ac27d723b4b991ea70b1d6c625f7e1b91de224 100755 (executable)
@@ -1,12 +1,12 @@
 #! /usr/bin/env python
 
-__all__ = ['import_glst']
-
 import codecs
 import os
 from sqlobject import sqlhub, SQLObjectNotFound
 from .db import Genre
 
+__all__ = ['import_glst']
+
 
 def parse_glst_file(glst_filename):
     glst_file = codecs.open(glst_filename, 'r', 'utf-8')
index dd32c0825494f45d58c5029288a312a1df6b3b8a..a030ebc8993dfe65735d773291f085baf964a14b 100644 (file)
@@ -1,6 +1,4 @@
 
-__all__ = ['import_inpx']
-
 import os
 from zipfile import ZipFile
 from sqlobject import sqlhub
@@ -8,6 +6,8 @@ from sqlobject.sqlbuilder import Select
 from .db import Author, Book, Extension, Genre, Language, \
     insert_name, insert_author
 
+__all__ = ['import_inpx']
+
 
 EOT = chr(4)  # INP field separator
 
index 2fbde60906edef7554ebf123f1425ad222317d88..635f194de1571e9927ae55d6f172f736249a1a79 100644 (file)
@@ -1,13 +1,13 @@
 
+from sqlobject.sqlbuilder import AND, func
+from .db import Author, Book, Extension, Genre, Language
+
 __all__ = [
     'mk_search_conditions',
     'search_authors', 'search_books', 'search_extensions',
     'search_genres', 'search_languages',
 ]
 
-from sqlobject.sqlbuilder import AND, func
-from .db import Author, Book, Extension, Genre, Language
-
 
 def _mk_search_conditions_with_operator(table, case_sensitive, comparison_op,
                                         values, expressions):
index a9462507c6eda7a70cca5cafa8db5a17b33f99ae..9f6ded74b53e19602c4c61e52098a0a179ece4d8 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,8 @@ if is_setuptools:
 
 versionpath = join(abspath(dirname(__file__)), 'm_librarian', '__version__.py')
 load_source('m_librarian_version', versionpath)
-from m_librarian_version import __version__
+# Ignore: E402 module level import not at top of file
+from m_librarian_version import __version__  # noqa
 
 setup(name='m_librarian',
       version=__version__,
index da9e6a5f19d5624729a1164a032aa2b3c21e955d..e40219aa38a0010d0601a0ed32216206baf78abf 100644 (file)
@@ -1,12 +1,11 @@
 
-__all__ = ['TestCase', 'main']
-
-
 import os
 import unittest
 from m_librarian.db import open_db, init_db
 from m_librarian.inp import import_inpx
 
+__all__ = ['TestCase', 'main']
+
 
 class TestCase(unittest.TestCase):
     def setUp(self):