
    Bh	                     v    d dl mZ d dlmZ d dlmZ ddlmZ  G d de      Z G d d	e      Z	 G d
 de      Z
y)    )LabelCommand)Page)	CMSPlugin   )SubcommandsCommandc                   "    e Zd ZdZdZdZdZd Zy)UninstallApphooksCommandAPPHOK_NAMEapphookszapphook name (eg SampleApp)z:Uninstalls (sets to null) specified apphooks for all pagesc                 d   t         j                  j                  |      }|j                         }|dkD  r]|j	                  d      rt        d||fz        }nd}|dk(  r3|j                  d        | j                  j                  d||fz         y y | j                  j                  d|z         y )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confirms         ]/home/dcms/DCMS/lib/python3.12/site-packages/cms/management/commands/subcommands/uninstall.pyhandle_labelz%UninstallApphooksCommand.handle_label   s    <<&&&>%^^-!{{=) !/ 3Ee1L!M N
  %6!!"BFXZ_E`"`a   KK85@A    N)__name__
__module____qualname__argscommand_namer   help_stringr    r    r   r	   r	   	   s    DL)ENKBr    r	   c                   &    e Zd ZdZdZdZdZdZd Zy)UninstallPluginsCommandPLUGIN_NAMEpluginszplugin name (eg SamplePlugin)z?Uninstalls (deletes) specified plugins from the CMSPlugin modelfoo barc                    t         j                  j                  |      }|j                         }|dkD  rv|j	                  d      rt        d||fz        }nd}|dk(  r1|j                          | j                  j                  d||fz         y | j                  j                  d       y | j                  j                  d|z         y )	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   s         r   r   z$UninstallPluginsCommand.handle_label)   s    $$+++>$NN,q {{=) !/ 3DU1K!L M
  %!!!"AEVX]D^"^_!!),KK7%?@r    N)	r!   r"   r#   r$   r%   r   r&   missing_args_messager   r'   r    r   r)   r)   "   s"    DL+ESK$Ar    r)   c                   "    e Zd ZdZdZdZeedZy)UninstallCommandz3Uninstall objects instances of the following types:	uninstallr,   )r   r+   N)	r!   r"   r#   r&   r%   r2   r	   r)   subcommandsr'   r    r   r4   r4   >   s    GKL$,*Kr    r4   N)django.core.management.baser   
cms.modelsr   cms.models.pluginmodelr   baser   r	   r)   r4   r'   r    r   <module>r;      s:    4  , $B| B2Al A8) r    