Mini Shell

Direktori : /lib/python3.6/site-packages/blivet/tasks/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/blivet/tasks/__pycache__/task.cpython-36.opt-1.pyc

3

{)c
�@s\ddlZddlmZeej�Gdd�de��ZGdd�de�Zeej�Gdd�de��ZdS)	�N)�
add_metaclassc@s^eZdZdZdZejdd�Zedd��Z	edd��Z
ejd	d�Zejd
d�Zej
dd��Zd
S)�Taskz. An abstract class that represents some task. Tz Brief description for this task.)�doccCs|jdd�|jD�S)zB Reasons if this task or the tasks it depends on are unavailable. cSsg|]}|jD]}|�qqS�)�availability_errors)�.0�t�err�/usr/lib/python3.6/task.py�
<listcomp>+sz,Task.availability_errors.<locals>.<listcomp>)�_availability_errors�
depends_on)�selfrrr
r'szTask.availability_errorscCs
|jgkS)z� True if the task is available, otherwise False.

            :returns: True if the task is available
            :rtype: bool
        )r)rrrr
�	available-szTask.availablez8Reasons if the necessary external tools are unavailable.ztasks that this task depends oncOs
t��dS)z Do the task for this class. N)�NotImplementedError)r�args�kwargsrrr
�do_task;szTask.do_taskN)�__name__�
__module__�__qualname__�__doc__�implemented�abc�abstractproperty�description�propertyrrrr
�abstractmethodrrrrr
rs	rc@s8eZdZdZdZdZedd��ZgZdd�Z	dd	�Z
d
S)�UnimplementedTaskzC A null Task, which returns a negative or empty for all properties.zan unimplemented taskFcCsdgS)Nz%Not implemented task can not succeed.r)rrrr
rHsz&UnimplementedTask._availability_errorscCsdS)Nzunimplemented taskr)rrrr
�__str__NszUnimplementedTask.__str__cOs
t��dS)N)r)rrrrrr
rQszUnimplementedTask.do_taskN)rrrrrrrrr
rrrrrr
rAsrc@s<eZdZdZejdd�Zdd�Zedd��Z	edd	��Z
d
S)�BasicApplicationz% A task representing an application. z.The object representing the external resource.)rcCs
t|j�S)N)�str�ext)rrrr
r^szBasicApplication.__str__cCs*|jj}|r"d|jdj|�fgSgSdS)Nz#application %s is not available: %sz and )r"r�join)r�errorsrrr
rasz%BasicApplication._availability_errorscCsgS)Nr)rrrr
r
iszBasicApplication.depends_onN)rrrrrrr"rrrr
rrrr
r Us
r )rZsixr�ABCMeta�objectrrr rrrr
�<module>s%