HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/janitor/plugincore/__pycache__/plugin.cpython-310.pyc
o

z��c
�@s<ddlmZmZmZeZdgZddlmZGdd�d�Z	dS)�)�absolute_import�print_function�unicode_literals�Plugin)�UnimplementedMethodc@sVeZdZdZedd��Zejdd��Zdd�Zdd�Zd	d
�Z	edd��Z
d
d�ZdS)rz~Base class for plugins.

    These plugins only do one thing: identify cruft. See the 'get_cruft'
    method for details.
    cCst|d�r|jSgS)N�
_condition)�hasattrr��self�r�;/usr/lib/python3/dist-packages/janitor/plugincore/plugin.py�	condition&szPlugin.conditioncCs
||_dS�N)r)r
r
rrrr
*�
cCs
||_dS)z4Set the Application instance this plugin belongs to.N)�app)r
rrrr�set_application.rzPlugin.set_applicationcCs"|��D]}|��q|��dS)zFFind cruft and clean it up.

        This is a helper method.
        N)�	get_cruft�cleanup�post_cleanup�r
�cruftrrr�do_cleanup_cruft2s
zPlugin.do_cleanup_cruftcCs
t|j��)asFind some cruft in the system.

        This method MUST return an iterator (see 'yield' statement).
        This interface design allows cruft to be collected piecemeal,
        which makes it easier to show progress in the user interface.

        The base class default implementation of this raises an
        exception. Subclasses MUST override this method.
        )rrr	rrrr;s

zPlugin.get_cruftccs�|��D]}|VqdSr)rrrrrrGs��zPlugin.cruftcCsdS)z�Do plugin-wide cleanup after the individual cleanup was performed.

        This is useful for stuff that needs to be processed in batches
        (e.g. for performance reasons) like package removal.
        Nrr	rrrrLszPlugin.post_cleanupN)�__name__�
__module__�__qualname__�__doc__�propertyr
�setterrrrrrrrrrrs	

	
N)
�
__future__rrr�type�
__metaclass__�__all__�janitor.plugincore.exceptionsrrrrrr�<module>s�