o
    k`d	                     @   sd   d dl mZ d dlmZ d dlmZ ddlmZ G dd deZG dd	 d	eZ	G d
d deZ
dS )    )LabelCommand)Page)	CMSPlugin   )SubcommandsCommandc                   @   s$   e Zd ZdZdZdZdZdd ZdS )UninstallApphooksCommandAPPHOK_NAMEapphookszapphook name (eg SampleApp)z:Uninstalls (sets to null) specified apphooks for all pagesc                 K   s   t jj|d}| }|dkr7|drtd||f }nd}|dkr5|jd d | jd||f  d S d S | jd|  d S )N)application_urlsr   interactivez}
You have requested to remove %d '%s' apphooks.
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yesz%d '%s' apphooks uninstalled
zno '%s' apphooks found
)	r   objectsfiltercountgetinputupdatestdoutwrite)selflabeloptionsquerysetnumber_of_apphooksconfirm r   l/var/www/mitschrieb_seite/venv/lib/python3.10/site-packages/cms/management/commands/subcommands/uninstall.pyhandle_label   s   
z%UninstallApphooksCommand.handle_labelN)__name__
__module____qualname__argscommand_namer   help_stringr   r   r   r   r   r   	   s    r   c                   @   s(   e Zd ZdZdZdZdZdZdd ZdS )	UninstallPluginsCommandPLUGIN_NAMEpluginszplugin name (eg SamplePlugin)z?Uninstalls (deletes) specified plugins from the CMSPlugin modelfoo barc                 K   s   t jj|d}| }|dkr;|drtd||f }nd}|dkr3|  | jd||f  d S | jd d S | jd|  d S )	N)plugin_typer   r   z|
You have requested to remove %d '%s' plugins.
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: r   z%d '%s' plugins uninstalled
Abortedzno '%s' plugins found
)	r   r   r   r   r   r   deleter   r   )r   r   r   r   number_of_pluginsr   r   r   r   r   )   s   
z$UninstallPluginsCommand.handle_labelN)	r   r   r    r!   r"   r   r#   missing_args_messager   r   r   r   r   r$   "   s    r$   c                   @   s"   e Zd ZdZdZdZeedZdS )UninstallCommandz3Uninstall objects instances of the following types:	uninstallr'   )r	   r&   N)	r   r   r    r#   r"   r,   r   r$   subcommandsr   r   r   r   r-   >   s    
r-   N)django.core.management.baser   
cms.modelsr   cms.models.pluginmodelr   baser   r   r$   r-   r   r   r   r   <module>   s    