mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-28 09:17:17 +00:00
review fixes
This commit is contained in:
parent
60bb880f9f
commit
2414686f3c
@ -31,12 +31,12 @@ class Remote:
|
|||||||
base class for remote package search
|
base class for remote package search
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
logger(logging.Logger): class logger
|
logger(logging.Logger): class logger
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""
|
"""
|
||||||
default constructor
|
default constructor
|
||||||
"""
|
"""
|
||||||
self.logger = logging.getLogger("build_details")
|
self.logger = logging.getLogger("build_details")
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ class Configuration(configparser.RawConfigParser):
|
|||||||
def repository_paths(self) -> RepositoryPaths:
|
def repository_paths(self) -> RepositoryPaths:
|
||||||
"""
|
"""
|
||||||
Returns:
|
Returns:
|
||||||
RepositoryPaths: repository paths instance
|
RepositoryPaths: repository paths instance
|
||||||
"""
|
"""
|
||||||
_, architecture = self.check_loaded()
|
_, architecture = self.check_loaded()
|
||||||
return RepositoryPaths(self.getpath("repository", "root"), architecture)
|
return RepositoryPaths(self.getpath("repository", "root"), architecture)
|
||||||
|
@ -33,10 +33,10 @@ def migrate_data(result: MigrationResult, connection: Connection,
|
|||||||
perform data migration
|
perform data migration
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
result(MigrationResult): result of the schema migration
|
result(MigrationResult): result of the schema migration
|
||||||
connection(Connection): database connection
|
connection(Connection): database connection
|
||||||
configuration(Configuration): configuration instance
|
configuration(Configuration): configuration instance
|
||||||
paths(RepositoryPaths): repository paths instance
|
paths(RepositoryPaths): repository paths instance
|
||||||
"""
|
"""
|
||||||
# initial data migration
|
# initial data migration
|
||||||
if result.old_version <= 0:
|
if result.old_version <= 0:
|
||||||
|
@ -154,11 +154,11 @@ class PackageOperations(Operations):
|
|||||||
select packages from the table
|
select packages from the table
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
connection(Connection): database connection
|
connection(Connection): database connection
|
||||||
packages(Dict[str, Package]): packages descriptor map
|
packages(Dict[str, Package]): packages descriptor map
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Dict[str, Package]: map of the package base to its descriptor including individual packages
|
Dict[str, Package]: map of the package base to its descriptor including individual packages
|
||||||
"""
|
"""
|
||||||
for row in connection.execute("""select * from packages"""):
|
for row in connection.execute("""select * from packages"""):
|
||||||
if row["package_base"] not in packages:
|
if row["package_base"] not in packages:
|
||||||
@ -172,10 +172,10 @@ class PackageOperations(Operations):
|
|||||||
select package build statuses from the table
|
select package build statuses from the table
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
connection(Connection): database connection
|
connection(Connection): database connection
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Dict[str, BuildStatus]: map of the package base to its status
|
Dict[str, BuildStatus]: map of the package base to its status
|
||||||
"""
|
"""
|
||||||
return {
|
return {
|
||||||
row["package_base"]: BuildStatus.from_json({"status": row["status"], "timestamp": row["last_updated"]})
|
row["package_base"]: BuildStatus.from_json({"status": row["status"], "timestamp": row["last_updated"]})
|
||||||
@ -187,7 +187,7 @@ class PackageOperations(Operations):
|
|||||||
remove package from database
|
remove package from database
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
package_base(str): package base name
|
package_base(str): package base name
|
||||||
"""
|
"""
|
||||||
def run(connection: Connection) -> None:
|
def run(connection: Connection) -> None:
|
||||||
self._package_remove_packages(connection, package_base, [])
|
self._package_remove_packages(connection, package_base, [])
|
||||||
@ -200,8 +200,8 @@ class PackageOperations(Operations):
|
|||||||
update package status
|
update package status
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
package(Package): package properties
|
package(Package): package properties
|
||||||
status(BuildStatus): new build status
|
status(BuildStatus): new build status
|
||||||
"""
|
"""
|
||||||
def run(connection: Connection) -> None:
|
def run(connection: Connection) -> None:
|
||||||
self._package_update_insert_base(connection, package)
|
self._package_update_insert_base(connection, package)
|
||||||
@ -216,7 +216,7 @@ class PackageOperations(Operations):
|
|||||||
get package list and their build statuses from database
|
get package list and their build statuses from database
|
||||||
|
|
||||||
Return:
|
Return:
|
||||||
List[Tuple[Package, BuildStatus]]: list of package properties and their statuses
|
List[Tuple[Package, BuildStatus]]: list of package properties and their statuses
|
||||||
"""
|
"""
|
||||||
def run(connection: Connection) -> Generator[Tuple[Package, BuildStatus], None, None]:
|
def run(connection: Connection) -> Generator[Tuple[Package, BuildStatus], None, None]:
|
||||||
packages = self._packages_get_select_package_bases(connection)
|
packages = self._packages_get_select_package_bases(connection)
|
||||||
|
@ -28,7 +28,7 @@ class ConfigurationPrinter(StringPrinter):
|
|||||||
print content of the configuration section
|
print content of the configuration section
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
values(Dict[str, str]): configuration values dictionary
|
values(Dict[str, str]): configuration values dictionary
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, section: str, values: Dict[str, str]) -> None:
|
def __init__(self, section: str, values: Dict[str, str]) -> None:
|
||||||
|
@ -31,8 +31,8 @@ class SearchView(BaseView):
|
|||||||
AUR search web view
|
AUR search web view
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
GET_PERMISSION(UserAccess): (class attribute) get permissions of self
|
GET_PERMISSION(UserAccess): (class attribute) get permissions of self
|
||||||
HEAD_PERMISSION(UserAccess): (class attribute) head permissions of self
|
HEAD_PERMISSION(UserAccess): (class attribute) head permissions of self
|
||||||
"""
|
"""
|
||||||
|
|
||||||
GET_PERMISSION = HEAD_PERMISSION = UserAccess.Read
|
GET_PERMISSION = HEAD_PERMISSION = UserAccess.Read
|
||||||
|
@ -49,7 +49,7 @@ def lock(args: argparse.Namespace, configuration: Configuration) -> Lock:
|
|||||||
configuration(Configuration): configuration fixture
|
configuration(Configuration): configuration fixture
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Lock: file lock test instance
|
Lock: file lock test instance
|
||||||
"""
|
"""
|
||||||
return Lock(args, "x86_64", configuration)
|
return Lock(args, "x86_64", configuration)
|
||||||
|
|
||||||
|
@ -77,6 +77,6 @@ def task_ahriman(package_ahriman: Package, configuration: Configuration, reposit
|
|||||||
repository_paths(RepositoryPaths): repository paths fixture
|
repository_paths(RepositoryPaths): repository paths fixture
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Task: built task test instance
|
Task: built task test instance
|
||||||
"""
|
"""
|
||||||
return Task(package_ahriman, configuration, repository_paths)
|
return Task(package_ahriman, configuration, repository_paths)
|
||||||
|
@ -19,7 +19,7 @@ def aur_package_ahriman_printer(aur_package_ahriman: AURPackage) -> AurPrinter:
|
|||||||
fixture for AUR package printer
|
fixture for AUR package printer
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
aur_package_ahriman(AURPackage): AUR package fixture
|
aur_package_ahriman(AURPackage): AUR package fixture
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
AurPrinter: AUR package printer test instance
|
AurPrinter: AUR package printer test instance
|
||||||
|
Loading…
Reference in New Issue
Block a user