ѠgdZddlZddlmZddlmZmZddlmZdZ d dZ d Z e d kr2ddl Z e \ZZer eeere jedSdSdS) z5 CloudLinux control panel API command line interface N)cpapi)prepare_data_jsonprepare_attention_json)cpapiexceptionsc6tjd}|ddddd|d }|d }|d d |d}|dd|d}|ddd|dddd|dd}|dt dd|S)Nz>%(prog)s - CloudLinux control panel API command line interface) descriptionz-jz--json store_trueFzOutput in json format)actiondefaulthelpcommand)destdocrootdomainzReturn document root for domain)r userdomainsz>NS   M cFdfd|DS)N c:g|]}|Sjoin).0tuple_seps r% zflat_plain..-s%:::6chhv&&:::r'r-)datar1s `r% flat_plainr4,s* 99::::T::: ; ;;r'ct}|}d}d} |jdkr@tj|j\}}|jrt||d}n|dz|z}n|jdkrLtj|j}|jrd|D}t|}nt|}n|jdkrFtj |j |j }|jrt|}n`t|}nP|jdkrEtj |j} |jrt| }nd | }nT#t j$rB} |jrt%t'| }nd }d t'| z}Yd} ~ nd} ~ wwxYw||fS) Nrr)ruserr(rc0g|]}|d|ddS)r)rrr,)r/domain_docroots r%r2zmain..?sEDDD*$2!#4$21$577DDDr'rrr*r8zERROR: )r& parse_argsr rrrjsonrrr4r cplogin_lstwith_system_usersr$rr.rCPAPIExceptionrr) r namespaceoutput_ exit_coderr6domain_docroot_pairsr3 db_mappinguserse_s r%mainrF0s ^^F!!##IGI#*   ) ) =)9::LFD~ .+vt,L,LMM 3,-  - / /#(#4Y5J#K#K ~ ;DD.BDDD,D11$%9::  "9 9 94Y5J5>5PRRJ~ 1+J77$Z00  "2 2 2()?@@E~ ++E22))E**  )*** > *,SWW55GGI#b'')G * I sEE,,F=;8F88F=__main__)r()__doc__rclcommonrclcommon.cloutputrrclcommon.cpapirr&r4rF__name__sysr@rAprintexitr,r'r%rPsGGGGGGGG******2<<<<)))X zJJJGY g  r'