Sindbad~EG File Manager

Current Path : /lib/python3.6/site-packages/vdo/vdomgmnt/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/vdo/vdomgmnt/__pycache__/Service.cpython-36.pyc

3

x?agb�@srdZddlmZddlmZddlmZddlmZddlmZddlm	Z	Gd	d
�d
ee
�ZGdd�de	�Zd
S)zz
  Service - Abstract superclass for services

  $Id: //eng/vdo-releases/aluminum/src/python/vdo/vdomgmnt/Service.py#2 $

�)�absolute_import)�division)�print_function)�unicode_literals�)�
ExitStatus)�
YAMLObjectcs*eZdZdZd�fdd�	Zdd�Z�ZS)�ServiceErrorz!Base class for service errors.
  �cstt|�j||�||_dS)N)�superr	�__init__�_msg)�self�msg�args�kwargs)�	__class__��/usr/lib/python3.6/Service.pyr,szServiceError.__init__cCs|jS)N)r
)rrrr�__str__1szServiceError.__str__)r
)�__name__�
__module__�__qualname__�__doc__rr�
__classcell__rr)rrr	!s	r	cs�eZdZdZdZedd��Zdd�Zedd��Z	e�fd	d
��Z
�fdd�Ze�fd
d��Z�fdd�Z
dd�Zdd�Z�ZS)�ServiceaESuperclass for services.

  Every subclass of Service controls a service (such as an Albireo
  index or a VDO target) managed by this command. The create/remove/
  have methods are one-time operations that do things like 'albcreate'
  that are persistent, while start/stop/running are used to control
  the availability of the service, either manually or automatically at
  system boot and shutdown. The control commands are idempotent, and
  return values specified as exit codes for /etc/init.d scripts
  specified in the LSB.

  Methods:
    getName  (method on Service) returns a name for the object
    create   creates the service; done once, paired with 'remove'
    remove   removes the service
    have     returns True if the service has been created
    start    starts the service; idempotent; run at system boot
    stop     stops the service; idempotent; run at shutdown
    running  returns True if the service is running
    getKeys  returns a list of the keys to be stored in the
             configuration file
    status   returns the status of the service in YAML format
  z!ServicecCsgS)z>Returns a list of keys to be stored in the configuration file.rrrrr�getKeysVszService.getKeyscCs|jS)z+Returns the name of a Service, as a string.)�_name)rrrr�getName\szService.getNamecCsdg}|j|j��|S)N�name)�extendr)r�keysrrr�_yamlAttributeKeyscszService._yamlAttributeKeyscstt|�j}|j�|d<|S)Nr)rr�	_yamlDatar)r�data)rrrr#jszService._yamlDatacstt|�j|�|d|_dS)Nr)rr�_yamlSetAttributesr)rZ
attributes)rrrr%qszService._yamlSetAttributescstt|�j}|jdg�|S)Nr)rr�_yamlSpeciallyHandledAttributesr )rZspecials)rrrr&vsz'Service._yamlSpeciallyHandledAttributescstt|�j�||_dS)N)rrrr)rr)rrrr}szService.__init__cCsdjt|�j|j��S)Nz{0}({1}))�format�typerr)rrrrr�szService.__str__cCs|jd�S)avReturns a boolean indicating if the entry represented by 'key' from the
       instance's __dict__ should be included in the __repr__ result.

    Arguments:
      key (str):  key from instance's __dict__
    Returns:
      bool: True, if the __dict__ entry with the specified key should be
                  included in the __repr__ result
            False, otherwise
    �_)�
startswith)r�keyrrr�_reprAttribute�szService._reprAttribute)rrrrZyaml_tag�staticmethodrr�propertyr"r#r%r&rrr,rrr)rrr9srN)
rZ
__future__rrrrr
rZ	vdo.utilsr�	Exceptionr	rrrrr�<module>s

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists