%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/janitor/plugincore/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/janitor/plugincore/__pycache__/cruft.cpython-312.pyc

�

9q�f���H�eZdgZddlmZe�ZddlmZGd�d�Zy)�Cruft�)�
setup_gettext)�UnimplementedMethodc��eZdZdZd�Zed��Zd�Zed��Zd�Z	ed��Z
d�Zed	��Zd
�Z
d�Zed��Zd
�Zed��Zd�Zy)ra3One piece of cruft to be cleaned out.

    A piece of cruft can be a file, a package, a configuration tweak that is
    missing, or something else.

    This is a base class, which does nothing. Subclasses do the actual work,
    though they must override the `get_shortname()` and `cleanup()` methods.
    c�.�|jjS)a�Return the unique prefix used to group this type of cruft.

        For example, the .deb package called 'foo' would have a prefix
        of 'deb'. This way, the package foo is not confused with the
        file foo, or the username foo.

        Subclasses SHOULD define this. The default implementation
        returns the name of the class, which is rarely useful to
        the user.
        )�	__class__�__name__��selfs �:/usr/lib/python3/dist-packages/janitor/plugincore/cruft.py�
get_prefixzCruft.get_prefix%s���~�~�&�&�&�c�"�|j�S�N)r
r
s r�prefixzCruft.prefix2s����� � rc�"�|j�S)z4Return human-readable description of class of cruft.��get_descriptionr
s r�get_prefix_descriptionzCruft.get_prefix_description6����#�#�%�%rc�"�|j�Sr)rr
s r�prefix_descriptionzCruft.prefix_description:s���*�*�,�,rc�,�t|j��)a�Return the name of this piece of cruft.

        The name should be something that the user will understand.  For
        example, it might be the name of a package, or the full path to a
        file.

        The name should be unique within the unique prefix returned by
        `get_prefix()`.  The prefix MUST NOT be included by this method, the
        `get_name()` method does that instead.  The intent is that
        `get_shortname()` will be used by the user interface in contexts where
        the prefix is shown separately from the short name, and `get_name()`
        when a single string is used.

        Subclasses MUST define this.  The default implementation raises an
        exception.
        )r�
get_shortnamer
s rrzCruft.get_shortname>s��""�$�"4�"4�5�5rc�"�|j�Sr)rr
s r�	shortnamezCruft.shortnameQs���!�!�#�#rc�N�dj|j|j�S)aJReturn prefix plus name.

        See `get_prefix()` and `get_shortname()` for a discussion of the
        prefix and the short name.  This method will return the prefix, a
        colon, and the short name.

        The long name will used to store state/configuration data: _this_
        package should not be removed.
        z{}:{})�formatrrr
s r�get_namezCruft.get_nameUs���~�~�d�k�k�4�>�>�:�:rc�"�|j�Sr)rr
s r�namez
Cruft.nameas���}�}��rc�b�dj|jj|j�S)Nz	<{} "{}">)rrr	r!r
s r�__repr__zCruft.__repr__es#���!�!�$�.�.�"9�"9�4�9�9�E�Erc��y)a�Return a description of this piece of cruft.

        This may be arbitrarily long.  The user interface will take care of
        breaking it into lines or otherwise presenting it to the user in a
        nice manner.  The description should be plain text UTF-8 unicode.

        The default implementation returns the empty string.  Subclasses MAY
        override this as they wish.
        ��r
s rrzCruft.get_descriptionhs��rc�"�|j�Srrr
s r�descriptionzCruft.descriptiontrrc��y)a`Return amount of disk space reserved by this piece of cruft.

        The unit is bytes.

        The disk space in question should be the amount that will be freed if
        the cruft is cleaned up.  The amount may be an estimate (i.e. a
        guess).  It is intended to be shown to the user to help them decide
        what to remove and what to keep.

        This will also be used by the user interface to better estimate how
        much remaining time there is when cleaning up a lot of cruft.

        For some types of cruft, this is not applicable and they should return
        `None`.  The base class implementation does that, so subclasses MUST
        define this method if it is useful for them to return something else.

        The user interface will distinguish between None (not applicable) and
        0 (no disk space being used).
        Nr&r
s r�get_disk_usagezCruft.get_disk_usagexs��(rc�"�|j�Sr)r*r
s r�
disk_usagezCruft.disk_usage�s���"�"�$�$rc�,�t|j��)aClean up this piece of cruft.

        Depending on the type of cruft, this may mean removing files,
        packages, modifying configuration files, or something else.

        The default implementation raises an exception.  Subclasses MUST
        override this.
        )r�cleanupr
s rr.z
Cruft.cleanup�s��"�$�,�,�/�/rN)r	�
__module__�__qualname__�__doc__r
�propertyrrrrrrr!r#rr(r*r,r.r&rrrrs����'��!��!�&��-��-�6�&�$��$�
;�����F�
��&��&��,�%��%�	0rN)	�type�
__metaclass__�__all__�janitor.plugincore.i18nr�_�janitor.plugincore.exceptionsrrr&rr�<module>r9s0���
��)��2��O��>�@0�@0r

Zerion Mini Shell 1.0