
    mit                     z    d Z ddlmZ ddlZddlZddlZddlZddlmZ ddl	m
Z
 ddlmZmZ  eed      Zd	efd
Zy)zo
The info commands gets the information on a Sheep or XP and can be used
to retrieve the job status, logs etc.
    )partialN   )DecoratedMain)Shepherd)
simple_logfatalzInfo:mainc                    t        |      }| j                  Lt        | j                        dkD  rt	        d       |j                  | j                        }|'t	        d       n|j                  | j                        }t        d|       t        d|j                  j                         |j                  rt        d|j                         | j                  rR|j                  |j                        }dt        |       d}|r|t        j                  |d	         z  }t        |       | j                  rN|j                  t        d
       n6|j!                         rt        d       n|j                  j                          | j                  r|j                  t	        d       |j                  j#                         st	        d|j                   d       t%        j&                  t)        |j                  d      t*        j,                  d       | j.                  rY|j                  j#                         st	        d|j                   d       t1        j2                  ddddd|j                  g       y y )Nr   z1If a job id is provided, you shouldn't pass argv.z!Could not find any matching sheepzFound sheepz	Folder iszMain log iszMetrics[z]: z!Could not cancel non existing jobzJob is not runningz(No log, sheep hasn't been scheduled yet.zLog z does not existri   tailz-n200z-f)r   job_idlenargvr   get_sheep_from_job_idget_sheep_from_argvlogxpfoldermetricsget_xp_historyjsondumpscanceljobis_doneexistsshutilcopyfileobjopensysstdoutr   osexecvp)argsr	   shepherdsheepr   outs         C/var/www/stems/demucs_env/lib/python3.12/site-packages/dora/info.pyinfo_actionr+      s   ~H{{tyy>AEF..t{{;=56,,TYY7uUXX__%yyM599%||%%ehh/Wc*4::gbk**CC{{9934]]_$%IIxx99<=yy!D?344		3/TByyyy!D?34
		&64eii@A     )__doc__	functoolsr   r   r$   r   r"   r	   r   shepr   r   r   r   r+    r,   r*   <module>r1      s>      	  
   "j'"$BM $Br,   