From 15f73467ed37cabe884f706a53ea4d9cc059822c Mon Sep 17 00:00:00 2001 From: Joey Vagedes Date: Wed, 6 Sep 2023 15:59:51 -0700 Subject: [PATCH] mend --- edk2toollib/database/edk2_db.py | 10 ++++------ edk2toollib/database/tables/base_table.py | 2 +- edk2toollib/database/tables/package_table.py | 4 +--- tests.unit/database/test_instanced_inf_table.py | 2 +- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/edk2toollib/database/edk2_db.py b/edk2toollib/database/edk2_db.py index d308fbac..b49b174f 100644 --- a/edk2toollib/database/edk2_db.py +++ b/edk2toollib/database/edk2_db.py @@ -30,7 +30,7 @@ class Edk2DB: """A SQLite3 database manager for a EDKII workspace. This class provides the ability to register parsers that will create / update tables in the database. This will - create a SQLite dabase file that can be queried using any SQLite3 client. VSCode provides multiple extensions + create a SQLite datbase file that can be queried using any SQLite3 client. VSCode provides multiple extensions for viewing and interacting with the database. Queries can also be created and run in python using the sqlite3 module that comes with python. @@ -61,10 +61,7 @@ def __init__(self, db_path: str, pathobj: Edk2Path, **kwargs: dict[str,Any]): Args: db_path: Path to create or load the database from pathobj: Edk2Path object for the workspace - **kwargs: see Keyword Arguments - - Keyword Arguments: - None + **kwargs: None """ self.pathobj = pathobj self.clear_parsers() @@ -96,7 +93,8 @@ def parse(self, env: dict) -> None: """Runs all registered table parsers against the database. !!! note - An environment table and row is always added to the database. This allows for filtering based on the environment. + An environment table and row is always added to the database. This allows for filtering based on the + environment. """ self.connection.execute(CREATE_JUNCTION_TABLE) id = str(uuid.uuid4().hex) diff --git a/edk2toollib/database/tables/base_table.py b/edk2toollib/database/tables/base_table.py index 43fc231a..6c8448d7 100644 --- a/edk2toollib/database/tables/base_table.py +++ b/edk2toollib/database/tables/base_table.py @@ -26,6 +26,6 @@ def create_tables(self, db_cursor: sqlite3.Cursor) -> None: """Create the tables necessary for this parser.""" raise NotImplementedError - def parse(self, db_cursor: sqlite3.Cursor, pathobj: Edk2Path) -> None: + def parse(self, db_cursor: sqlite3.Cursor, pathobj: Edk2Path, id: str, env: dict) -> None: """Execute the parser and update the database.""" raise NotImplementedError diff --git a/edk2toollib/database/tables/package_table.py b/edk2toollib/database/tables/package_table.py index ccc5e5c7..8d2224ba 100644 --- a/edk2toollib/database/tables/package_table.py +++ b/edk2toollib/database/tables/package_table.py @@ -32,10 +32,8 @@ def __init__(self, *args, **kwargs): Args: args (any): non-keyword arguments - kwargs (any): keyword arguments described below + kwargs (any): None - Keyword Arguments: - None """ def create_tables(self, db_cursor: Cursor) -> None: diff --git a/tests.unit/database/test_instanced_inf_table.py b/tests.unit/database/test_instanced_inf_table.py index 1b988484..04e80acd 100644 --- a/tests.unit/database/test_instanced_inf_table.py +++ b/tests.unit/database/test_instanced_inf_table.py @@ -278,7 +278,7 @@ def test_multiple_library_class(empty_tree: Tree): results = db.connection.execute("SELECT key1, key2 FROM junction").fetchall() - # Verify that TestDrver1 uses TestLib acting as TestCls1 + # Verify that TestDriver1 uses TestLib acting as TestCls1 assert results[0] == ('2','1') # idx 2 is TestDriver1, idx1 is TestLib1 acting as TestCsl1 assert ("TestLib", "TestCls1") == db.connection.execute("SELECT name, class FROM instanced_inf where id = 1").fetchone() assert ("TestDriver1",) == db.connection.execute("SELECT name FROM instanced_inf where id = 2").fetchone()