From e35e7ec406bc1907e3eef22980de84317a0f7a4d Mon Sep 17 00:00:00 2001 From: pyrco <105293448+pyrco@users.noreply.github.com> Date: Tue, 7 Feb 2023 09:38:58 +0100 Subject: [PATCH] Add isort to flake8 linting (#16) (DIS-1789) --- dissect/esedb/__init__.py | 1 - dissect/esedb/c_esedb.py | 2 +- dissect/esedb/cursor.py | 2 +- dissect/esedb/esedb.py | 4 ++-- dissect/esedb/page.py | 2 +- dissect/esedb/table.py | 8 +++++++- dissect/esedb/tools/sru.py | 3 +-- dissect/esedb/tools/ual.py | 1 - setup.py | 2 +- tests/conftest.py | 2 +- tests/test_esedb.py | 2 +- tox.ini | 1 + 12 files changed, 17 insertions(+), 13 deletions(-) diff --git a/dissect/esedb/__init__.py b/dissect/esedb/__init__.py index a87e78d..dbbc798 100755 --- a/dissect/esedb/__init__.py +++ b/dissect/esedb/__init__.py @@ -6,7 +6,6 @@ NoNeighbourPageError, ) - __all__ = [ "EseDB", "Error", diff --git a/dissect/esedb/c_esedb.py b/dissect/esedb/c_esedb.py index 155c8b4..47732ce 100644 --- a/dissect/esedb/c_esedb.py +++ b/dissect/esedb/c_esedb.py @@ -1,6 +1,6 @@ import datetime -import uuid import struct +import uuid from collections import namedtuple from typing import Union diff --git a/dissect/esedb/cursor.py b/dissect/esedb/cursor.py index 965438b..f8eceaa 100644 --- a/dissect/esedb/cursor.py +++ b/dissect/esedb/cursor.py @@ -2,8 +2,8 @@ from typing import TYPE_CHECKING, Union -from dissect.esedb.page import Page, Node from dissect.esedb.exceptions import KeyNotFoundError, NoNeighbourPageError +from dissect.esedb.page import Node, Page if TYPE_CHECKING: from dissect.esedb.esedb import EseDB diff --git a/dissect/esedb/esedb.py b/dissect/esedb/esedb.py index 30d1de7..c22f599 100755 --- a/dissect/esedb/esedb.py +++ b/dissect/esedb/esedb.py @@ -5,10 +5,10 @@ from functools import cached_property, lru_cache from typing import BinaryIO, Iterator -from dissect.esedb.page import Page -from dissect.esedb.table import Catalog, Table from dissect.esedb.c_esedb import c_esedb, pgnoFDPMSO, ulDAEMagic from dissect.esedb.exceptions import InvalidDatabase +from dissect.esedb.page import Page +from dissect.esedb.table import Catalog, Table class EseDB: diff --git a/dissect/esedb/page.py b/dissect/esedb/page.py index 56ffa28..350a2c4 100644 --- a/dissect/esedb/page.py +++ b/dissect/esedb/page.py @@ -4,7 +4,7 @@ from functools import cached_property from typing import TYPE_CHECKING, Iterator, Optional, Union -from dissect.esedb.c_esedb import c_esedb, PAGE_FLAG, TAG_FLAG +from dissect.esedb.c_esedb import PAGE_FLAG, TAG_FLAG, c_esedb if TYPE_CHECKING: from dissect.esedb.esedb import EseDB diff --git a/dissect/esedb/table.py b/dissect/esedb/table.py index 3899e52..4a07095 100644 --- a/dissect/esedb/table.py +++ b/dissect/esedb/table.py @@ -5,7 +5,13 @@ from typing import TYPE_CHECKING, Any, Iterator, Optional from dissect.esedb import compression -from dissect.esedb.c_esedb import CODEPAGE, COLUMN_TYPE_MAP, SYSOBJ, ColumnType, JET_coltyp +from dissect.esedb.c_esedb import ( + CODEPAGE, + COLUMN_TYPE_MAP, + SYSOBJ, + ColumnType, + JET_coltyp, +) from dissect.esedb.cursor import Cursor from dissect.esedb.exceptions import NoNeighbourPageError from dissect.esedb.index import Index diff --git a/dissect/esedb/tools/sru.py b/dissect/esedb/tools/sru.py index 7055982..265e1e8 100644 --- a/dissect/esedb/tools/sru.py +++ b/dissect/esedb/tools/sru.py @@ -4,14 +4,13 @@ from typing import BinaryIO, Iterator, Optional from dissect.util.sid import read_sid -from dissect.util.ts import wintimestamp, oatimestamp +from dissect.util.ts import oatimestamp, wintimestamp from dissect.esedb.c_esedb import RecordValue from dissect.esedb.esedb import EseDB from dissect.esedb.record import Record, serialise_record_column_values from dissect.esedb.table import Table - NATIVE_TYPE_MAP = { "{DD6636C4-8929-4683-974E-22C046A43763}": {"ConnectStartTime": wintimestamp}, "{5C8CF1C7-7257-4F13-B223-970EF5939312}": {"EndTime": wintimestamp}, diff --git a/dissect/esedb/tools/ual.py b/dissect/esedb/tools/ual.py index e7e0a7f..9827ee2 100644 --- a/dissect/esedb/tools/ual.py +++ b/dissect/esedb/tools/ual.py @@ -9,7 +9,6 @@ from dissect.esedb.esedb import EseDB from dissect.esedb.table import Table - UalValue = Union[RecordValue, ipaddress.IPv4Address, ipaddress.IPv6Interface, Tuple[datetime.datetime]] SKIP_TABLES = [ diff --git a/setup.py b/setup.py index 37e6837..754654f 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -from setuptools import setup, find_packages +from setuptools import find_packages, setup setup( name="dissect.esedb", diff --git a/tests/conftest.py b/tests/conftest.py index 2479248..6a58ffb 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,5 @@ -import os import gzip +import os import pytest diff --git a/tests/test_esedb.py b/tests/test_esedb.py index 566194e..91e1114 100644 --- a/tests/test_esedb.py +++ b/tests/test_esedb.py @@ -2,8 +2,8 @@ from dissect.util.ts import oatimestamp -from dissect.esedb.esedb import EseDB from dissect.esedb.c_esedb import JET_coltyp +from dissect.esedb.esedb import EseDB def test_basic_types(basic_db): diff --git a/tox.ini b/tox.ini index 2160d23..f2b225f 100644 --- a/tox.ini +++ b/tox.ini @@ -39,6 +39,7 @@ deps = black==23.1.0 flake8 flake8-black + flake8-isort vermin commands = flake8 dissect tests setup.py