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
|
||||
|
||||
Attributes:
|
||||
logger(logging.Logger): class logger
|
||||
logger(logging.Logger): class logger
|
||||
"""
|
||||
|
||||
def __init__(self) -> None:
|
||||
"""
|
||||
default constructor
|
||||
default constructor
|
||||
"""
|
||||
self.logger = logging.getLogger("build_details")
|
||||
|
||||
|
@ -82,7 +82,7 @@ class Configuration(configparser.RawConfigParser):
|
||||
def repository_paths(self) -> RepositoryPaths:
|
||||
"""
|
||||
Returns:
|
||||
RepositoryPaths: repository paths instance
|
||||
RepositoryPaths: repository paths instance
|
||||
"""
|
||||
_, architecture = self.check_loaded()
|
||||
return RepositoryPaths(self.getpath("repository", "root"), architecture)
|
||||
|
@ -33,10 +33,10 @@ def migrate_data(result: MigrationResult, connection: Connection,
|
||||
perform data migration
|
||||
|
||||
Args:
|
||||
result(MigrationResult): result of the schema migration
|
||||
connection(Connection): database connection
|
||||
configuration(Configuration): configuration instance
|
||||
paths(RepositoryPaths): repository paths instance
|
||||
result(MigrationResult): result of the schema migration
|
||||
connection(Connection): database connection
|
||||
configuration(Configuration): configuration instance
|
||||
paths(RepositoryPaths): repository paths instance
|
||||
"""
|
||||
# initial data migration
|
||||
if result.old_version <= 0:
|
||||
|
@ -154,11 +154,11 @@ class PackageOperations(Operations):
|
||||
select packages from the table
|
||||
|
||||
Args:
|
||||
connection(Connection): database connection
|
||||
packages(Dict[str, Package]): packages descriptor map
|
||||
connection(Connection): database connection
|
||||
packages(Dict[str, Package]): packages descriptor map
|
||||
|
||||
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"""):
|
||||
if row["package_base"] not in packages:
|
||||
@ -172,10 +172,10 @@ class PackageOperations(Operations):
|
||||
select package build statuses from the table
|
||||
|
||||
Args:
|
||||
connection(Connection): database connection
|
||||
connection(Connection): database connection
|
||||
|
||||
Returns:
|
||||
Dict[str, BuildStatus]: map of the package base to its status
|
||||
Dict[str, BuildStatus]: map of the package base to its status
|
||||
"""
|
||||
return {
|
||||
row["package_base"]: BuildStatus.from_json({"status": row["status"], "timestamp": row["last_updated"]})
|
||||
@ -187,7 +187,7 @@ class PackageOperations(Operations):
|
||||
remove package from database
|
||||
|
||||
Args:
|
||||
package_base(str): package base name
|
||||
package_base(str): package base name
|
||||
"""
|
||||
def run(connection: Connection) -> None:
|
||||
self._package_remove_packages(connection, package_base, [])
|
||||
@ -200,8 +200,8 @@ class PackageOperations(Operations):
|
||||
update package status
|
||||
|
||||
Args:
|
||||
package(Package): package properties
|
||||
status(BuildStatus): new build status
|
||||
package(Package): package properties
|
||||
status(BuildStatus): new build status
|
||||
"""
|
||||
def run(connection: Connection) -> None:
|
||||
self._package_update_insert_base(connection, package)
|
||||
@ -216,7 +216,7 @@ class PackageOperations(Operations):
|
||||
get package list and their build statuses from database
|
||||
|
||||
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]:
|
||||
packages = self._packages_get_select_package_bases(connection)
|
||||
|
@ -28,7 +28,7 @@ class ConfigurationPrinter(StringPrinter):
|
||||
print content of the configuration section
|
||||
|
||||
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:
|
||||
|
@ -31,8 +31,8 @@ class SearchView(BaseView):
|
||||
AUR search web view
|
||||
|
||||
Attributes:
|
||||
GET_PERMISSION(UserAccess): (class attribute) get permissions of self
|
||||
HEAD_PERMISSION(UserAccess): (class attribute) head permissions of self
|
||||
GET_PERMISSION(UserAccess): (class attribute) get permissions of self
|
||||
HEAD_PERMISSION(UserAccess): (class attribute) head permissions of self
|
||||
"""
|
||||
|
||||
GET_PERMISSION = HEAD_PERMISSION = UserAccess.Read
|
||||
|
@ -49,7 +49,7 @@ def lock(args: argparse.Namespace, configuration: Configuration) -> Lock:
|
||||
configuration(Configuration): configuration fixture
|
||||
|
||||
Returns:
|
||||
Lock: file lock test instance
|
||||
Lock: file lock test instance
|
||||
"""
|
||||
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
|
||||
|
||||
Returns:
|
||||
Task: built task test instance
|
||||
Task: built task test instance
|
||||
"""
|
||||
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
|
||||
|
||||
Args:
|
||||
aur_package_ahriman(AURPackage): AUR package fixture
|
||||
aur_package_ahriman(AURPackage): AUR package fixture
|
||||
|
||||
Returns:
|
||||
AurPrinter: AUR package printer test instance
|
||||
|
Loading…
Reference in New Issue
Block a user