From: Oleg Broytman Date: Fri, 29 Dec 2023 08:26:50 +0000 (+0300) Subject: Style: Re-group and reorder imports X-Git-Tag: 0.3.0~18 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=3dc2cc5a2a9967b89f3017b2f9214821b5582c6a;p=m_librarian.git Style: Re-group and reorder imports --- diff --git a/m_librarian/db.py b/m_librarian/db.py index d910688..064ca9a 100755 --- a/m_librarian/db.py +++ b/m_librarian/db.py @@ -2,9 +2,11 @@ from __future__ import print_function import os + from sqlobject import SQLObject, StringCol, UnicodeCol, IntCol, BoolCol, \ ForeignKey, DateCol, DatabaseIndex, RelatedJoin, \ connectionForURI, sqlhub, SQLObjectNotFound, dberrors + from .compat import string_type from .config import get_config diff --git a/m_librarian/glst.py b/m_librarian/glst.py index fedb27b..206dcc4 100755 --- a/m_librarian/glst.py +++ b/m_librarian/glst.py @@ -1,9 +1,10 @@ #! /usr/bin/env python from __future__ import print_function -import codecs from glob import glob +import codecs import os + from sqlobject import sqlhub, SQLObjectNotFound from .db import Genre diff --git a/m_librarian/inp.py b/m_librarian/inp.py index 3789dd2..f910b10 100644 --- a/m_librarian/inp.py +++ b/m_librarian/inp.py @@ -1,8 +1,10 @@ import os from zipfile import ZipFile + from sqlobject import sqlhub from sqlobject.sqlbuilder import Select + from .db import Author, Book, Extension, Genre, Language, \ insert_name, insert_author diff --git a/m_librarian/web/app.py b/m_librarian/web/app.py index a5ea5b2..38e5bea 100644 --- a/m_librarian/web/app.py +++ b/m_librarian/web/app.py @@ -2,8 +2,8 @@ import os -from sqlobject.sqlbuilder import CONCAT from bottle import cheetah_view, redirect, request, route, static_file +from sqlobject.sqlbuilder import CONCAT from ..config import get_config from ..db import Author, Book diff --git a/scripts/ml-initdb.py b/scripts/ml-initdb.py index c229c5e..4c21b1a 100755 --- a/scripts/ml-initdb.py +++ b/scripts/ml-initdb.py @@ -1,6 +1,7 @@ #! /usr/bin/env python import argparse + from m_librarian.config import get_config from m_librarian.db import open_db, init_db from m_librarian.glst import import_glst diff --git a/scripts/ml-search.py b/scripts/ml-search.py index 28daa0b..7e6c9da 100755 --- a/scripts/ml-search.py +++ b/scripts/ml-search.py @@ -4,6 +4,7 @@ from __future__ import print_function import argparse import os import sys + from sqlobject.sqlbuilder import CONCAT from m_lib.defenc import default_encoding diff --git a/scripts/ml-web.py b/scripts/ml-web.py index 773be00..c93b5fd 100755 --- a/scripts/ml-web.py +++ b/scripts/ml-web.py @@ -7,9 +7,9 @@ import webbrowser from bottle import thread # portable import from m_librarian.db import open_db -import m_librarian.web.app # noqa: F401 imported but unused from m_librarian.web.server import run_server from m_librarian.web.utils import get_lock, close_lock, get_open_port +import m_librarian.web.app # noqa: F401 imported but unused def start_browser(port): diff --git a/tests/dbutils.py b/tests/dbutils.py index bb5a362..06a9e9c 100644 --- a/tests/dbutils.py +++ b/tests/dbutils.py @@ -1,6 +1,8 @@ import os + from sqlobject.tests.dbtest import getConnection + from m_librarian.db import open_db, init_db from m_librarian.inp import import_inpx