Mini Shell
3
{)c
� @ s� d dl Z d dlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd lm Z ee j
�G d
d� de jej��Z
G dd
� d
e
�ZG dd� de
�ZG dd� de
�ZG dd� de
�ZG dd� de
�ZG dd� dej�ZdS )� N)�
add_metaclass� )�FSError)�util� )�availability)�fstask)�taskc @ s4 e Zd ZdZdZejdd�Zedd� �Z dd� Z
d S )
�FSInfozA An abstract class that represents an information gathering app. zfilesystem infoz%Options for invoking the application.)�docc C s t | j�g| j | jjg S )z� Returns the command for reading filesystem information.
:returns: a list of appropriate options
:rtype: list of str
)�str�ext�optionsZfsZdevice)�self� r �/usr/lib/python3.6/fsinfo.py�
_info_command, s zFSInfo._info_commandc C sx | j }|rtdj|���d}y tj| j�\}}|r:d| }W n* tk
rf } zd| }W Y dd}~X nX |rtt|��|S )z� Returns information from the command.
:returns: a string representing the output of the command
:rtype: str
:raises FSError: if info cannot be obtained
�
Nzfailed to gather fs info: %s)Zavailability_errorsr �joinr Zrun_program_and_capture_outputr �OSError)r Z
error_msgsZ error_msgZrc�out�er r r �do_task5 s zFSInfo.do_taskN)�__name__�
__module__�__qualname__�__doc__�description�abc�abstractpropertyr �propertyr r r r r r r
"