Skip to content

Commit

Permalink
acacore - sort imports
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoCampinoti94 committed Oct 17, 2023
1 parent 585eefe commit 8b2e2e2
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 16 deletions.
16 changes: 13 additions & 3 deletions acacore/database/base.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
from datetime import datetime
from os import PathLike
from pathlib import Path
from sqlite3 import Connection, OperationalError
from sqlite3 import Connection
from sqlite3 import Cursor as SQLiteCursor
from typing import Any, Generator, Generic, Optional, Type, TypeVar, Union, overload
from sqlite3 import OperationalError
from typing import Any
from typing import Generator
from typing import Generic
from typing import Optional
from typing import Type
from typing import TypeVar
from typing import Union
from typing import overload

from pydantic.main import BaseModel

from .column import Column, SelectColumn, model_to_columns
from .column import Column
from .column import SelectColumn
from .column import model_to_columns

T = TypeVar("T")
R = TypeVar("R")
Expand Down
7 changes: 6 additions & 1 deletion acacore/database/column.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
from datetime import datetime
from pathlib import Path
from typing import Callable, Generic, Optional, Type, TypeVar, Union
from typing import Callable
from typing import Generic
from typing import Optional
from typing import Type
from typing import TypeVar
from typing import Union
from uuid import UUID

from pydantic import BaseModel
Expand Down
11 changes: 8 additions & 3 deletions acacore/database/files_db.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
from datetime import datetime
from os import PathLike
from sqlite3 import Connection
from typing import Optional, Type, Union
from typing import Optional
from typing import Type
from typing import Union
from uuid import UUID

from acacore.utils.functions import or_none

from .base import Column, FileDBBase, SelectColumn
from .base import Column
from .base import FileDBBase
from .base import SelectColumn


class FileDB(FileDBBase):
Expand Down Expand Up @@ -41,7 +45,8 @@ def __init__(
to avoid parsing overhead.
uri: If set to True, database is interpreted as a URI with a file path and an optional query string.
"""
from acacore.models.file import ConvertedFile, File
from acacore.models.file import ConvertedFile
from acacore.models.file import File
from acacore.models.history import HistoryEntry
from acacore.models.identification import SignatureCount
from acacore.models.metadata import Metadata
Expand Down
9 changes: 6 additions & 3 deletions acacore/models/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
# -----------------------------------------------------------------------------
import re
from pathlib import Path
from typing import Optional, Tuple
from typing import Optional
from typing import Tuple

from pydantic import UUID4, Field
from pydantic import UUID4
from pydantic import Field

from acacore.models.reference_files import CustomSignature
from acacore.siegfried.siegfried import Siegfried, SiegfriedFile
from acacore.siegfried.siegfried import Siegfried
from acacore.siegfried.siegfried import SiegfriedFile
from acacore.utils.io import size_fmt

from .base import ACABase
Expand Down
4 changes: 3 additions & 1 deletion acacore/models/file_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from pathlib import Path
from typing import Any, ClassVar, Optional
from typing import Any
from typing import ClassVar
from typing import Optional

from pydantic import model_validator

Expand Down
3 changes: 2 additions & 1 deletion acacore/models/history.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from datetime import datetime
from typing import Optional, Union
from typing import Optional
from typing import Union

from pydantic import UUID4

Expand Down
3 changes: 2 additions & 1 deletion acacore/models/identification.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Any, Optional
from typing import Any
from typing import Optional

from pydantic import model_validator

Expand Down
3 changes: 2 additions & 1 deletion acacore/reference_files/ref_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from http.client import HTTPResponse
from urllib import request

from models.reference_files import CustomSignature, ReIdentifyModel
from models.reference_files import CustomSignature
from models.reference_files import ReIdentifyModel


@lru_cache
Expand Down
4 changes: 3 additions & 1 deletion acacore/utils/functions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from typing import Callable, Optional, TypeVar
from typing import Callable
from typing import Optional
from typing import TypeVar

T = TypeVar("T")
R = TypeVar("R")
Expand Down
6 changes: 5 additions & 1 deletion acacore/utils/log.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
from logging import INFO, FileHandler, Formatter, Logger, getLogger
from logging import INFO
from logging import FileHandler
from logging import Formatter
from logging import Logger
from logging import getLogger
from pathlib import Path


Expand Down

0 comments on commit 8b2e2e2

Please sign in to comment.