ahriman.application package

Subpackages

Submodules

ahriman.application.ahriman module

ahriman.application.lock module

class Lock(args: Namespace, repository_id: RepositoryId, configuration: Configuration)

Bases: LazyLogging

wrapper for application lock file

force

remove lock file on start if any

Type:

bool

path

path to lock file if any

Type:

Path

reporter

build status reporter instance

Type:

Client

paths

repository paths instance

Type:

RepositoryPaths

unsafe

skip user check

Type:

bool

wait_timeout

wait in seconds until lock will free

Type:

int

Examples

Instance of this class except for controlling file-based lock is also required for basic applications checks. The common flow is to create instance in with block and handle exceptions after all:

>>> from ahriman.core.configuration import Configuration
>>> from ahriman.models.repository_id import RepositoryId
>>>
>>> configuration = Configuration()
>>> try:
>>>     with Lock(args, RepositoryId("x86_64", "aur-clone"), configuration):
>>>         perform_actions()
>>> except Exception as exception:
>>>     handle_exceptions(exception)

default constructor

Parameters:
  • args (argparse.Namespace) – command line args

  • repository_id (RepositoryId) – repository unique identifier

  • configuration (Configuration) – configuration instance

check_user() None

check if current user is actually owner of ahriman root

check_version() None

check web server version

clear() None

remove lock file

create() None

create lock file

Raises:

DuplicateRunError – if lock exists and no force flag supplied

watch() None

watch until lock disappear

Module contents