diff sat/memory/sqla.py @ 3893:045af0eeda3f

core, CLI (base), tools (common/data_format): typing/core readability
author Goffi <goffi@goffi.org>
date Wed, 21 Sep 2022 22:20:43 +0200
parents 100dd30244c6
children 1a77e1f866f9
line wrap: on
line diff
--- a/sat/memory/sqla.py	Wed Aug 31 17:07:03 2022 +0200
+++ b/sat/memory/sqla.py	Wed Sep 21 22:20:43 2022 +0200
@@ -16,61 +16,67 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-import sys
-import time
 import asyncio
+from asyncio.subprocess import PIPE
 import copy
 from datetime import datetime
-from asyncio.subprocess import PIPE
 from pathlib import Path
-from typing import Union, Dict, List, Tuple, Iterable, Any, Callable, Optional
-from sqlalchemy.ext.asyncio import AsyncSession, AsyncEngine, create_async_engine
+import sys
+import time
+from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union
+
+from alembic import config as al_config, script as al_script
+from alembic.runtime import migration as al_migration
+from sqlalchemy import and_, delete, event, func, or_, update
+from sqlalchemy import Integer, literal_column, text
+from sqlalchemy.dialects.sqlite import insert
+from sqlalchemy.engine import Connection, Engine
 from sqlalchemy.exc import IntegrityError, NoResultFound
+from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession, create_async_engine
+from sqlalchemy.future import select
 from sqlalchemy.orm import (
-    sessionmaker, subqueryload, joinedload, selectinload, contains_eager
+    contains_eager,
+    joinedload,
+    selectinload,
+    sessionmaker,
+    subqueryload,
 )
+from sqlalchemy.orm.attributes import Mapped
 from sqlalchemy.orm.decl_api import DeclarativeMeta
-from sqlalchemy.orm.attributes import Mapped
-from sqlalchemy.future import select
-from sqlalchemy.engine import Engine, Connection
-from sqlalchemy import update, delete, and_, or_, event, func
-from sqlalchemy.sql.functions import coalesce, sum as sum_, now, count
-from sqlalchemy.dialects.sqlite import insert
-from sqlalchemy import text, literal_column, Integer
-from alembic import script as al_script, config as al_config
-from alembic.runtime import migration as al_migration
+from sqlalchemy.sql.functions import coalesce, count, now, sum as sum_
 from twisted.internet import defer
 from twisted.words.protocols.jabber import jid
 from twisted.words.xish import domish
-from sat.core.i18n import _
+
 from sat.core import exceptions
-from sat.core.log import getLogger
 from sat.core.constants import Const as C
 from sat.core.core_types import SatXMPPEntity
-from sat.tools.utils import aio, as_future
-from sat.tools.common import uri
+from sat.core.i18n import _
+from sat.core.log import getLogger
 from sat.memory import migration
 from sat.memory import sqla_config
 from sat.memory.sqla_mapping import (
-    NOT_IN_EXTRA,
-    SyncState,
     Base,
-    Profile,
     Component,
+    File,
     History,
     Message,
-    Subject,
-    Thread,
+    NOT_IN_EXTRA,
     ParamGen,
     ParamInd,
     PrivateGen,
+    PrivateGenBin,
     PrivateInd,
-    PrivateGenBin,
     PrivateIndBin,
-    File,
+    Profile,
+    PubsubItem,
     PubsubNode,
-    PubsubItem,
+    Subject,
+    SyncState,
+    Thread,
 )
+from sat.tools.common import uri
+from sat.tools.utils import aio, as_future
 
 
 log = getLogger(__name__)