
    Id                     R    d Z ddlmZ ddlmZ  G d de      Z G d de      Zd Z	y	)
z+The main samba-tool command implementation.    )getopt)SuperCommandc                   $    e Zd ZdZd ZddZd Zy)cache_loaderz
    We only load subcommand tools if they are actually used.
    This significantly reduces the amount of time spent starting up
    samba-tool
    c                     t         j                  | |      }|2|dk(  rdn|} t        t        d|z  d|z  g      d|z               | |<   t         j                  | |      S )Ntimenettimezsamba.netcmd.%szcmd_%s)fromlist)dict__getitem__getattr
__import__)selfattritempackages       3/usr/lib/python3/dist-packages/samba/netcmd/main.pyr   zcache_loader.__getitem__   ss    d+<#'6>itG2,=,G6>o5F"H!)D2 4DJ d++    Nc                 0    	 | |   S # t         $ r |cY S w xY wN)KeyError)r   r   defaults      r   getzcache_loader.get(   s%    	: 	N	s    c              #   ,   K   | D ]  }|| |   f  y wr    )r   keys     r   itemszcache_loader.items.   s$      	#CS	""	#s   r   )__name__
__module____qualname____doc__r   r   r   r   r   r   r   r      s    
,#r   r   c                   *   e Zd ZdZdej
                  iZ e       Zded<   ded<   ded<   ded<   ded<   ded	<   ded
<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   y)cmd_sambatoolzMain samba administration tool.versionoptsNcomputercontactdbcheck
delegationdnsdomaindrsdsaclforestfsmogpogroupldapcmpntaclrodcschemasitesspntestparmr   userou	processes	visualize)	r   r   r    r!   optionsVersionOptionstakes_optiongroupsr   subcommandsr   r   r   r#   r#   3   s   ) 	w-- .K"K
!K	!K	 $KK KKK KKKK!K	KK KKK"K
KKK#K#Kr   r#   c                      	  t               j                  dg| i |\  }} |j                  | }|S # t        $ r}|j                  }Y d}~|S d}~wt
        $ r}j                  |       d}Y d}~|S d}~ww xY w)zbA single function that runs samba-tool, returning an error code on
    error, and None on success.z
samba-toolN   )r#   _resolve_run
SystemExitcode	Exceptionshow_command_error)argskwargscmdargvretes         r   
samba_toolrN   V   s    ,MO,,\KDKFK	Tchho J  ff J  q!Js    04 	A9AA9A44A9N)
r!   sambar   r<   samba.netcmdr   r   r   r#   rN   r   r   r   <module>rQ      s.   $ 2 # %#4 #4 $L  $Fr   