+
     [;i  c                   s    ^ RI Ht ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHtHtHt ^ R	IHt ^ R
IHtHt ^ RIHt  ! R R]4      tR# )i    )absolute_importN)NoSuchProcess)Package)System)FilenameCleaner)AffectedProcess)ApplicationsCollectionAffectedProcessesCollectionPackagesCollection)UnsupportedDistribution)ApplicationsAffectedApplication)_c                   s   a  ] tR t^!t o Rt Rt Rt Rt Rt Rt	 Rt
Rt Rt RtRR ltR tRR ltR tR tR	 t]3R
 lt]3R ltR tRtV tR# )Tracerz9Tracer finds outdated running applications in your systemNFc                s    V'       g   \        \        P                  ! 4       4      hWn        W n        W0n        W@n        WPn        W`n        R # N)	r	   r   Zdistribution_PACKAGE_MANAGER_rules_applications_memory_hooks_observer_erased)selfZpackage_managerZrulesZapplicationsmemoryZhooks_observerZeraseds   &&&&&&&</usr/lib/python3.14/site-packages/tracer/resources/tracer.py__init__ZTracer.__init__B   s:    		 !4!4!6	77)+#,',    c                sJ   V P                   '       d(   V P                  '       d   \        V P                   4      # V P                  '       d   V P                  M\        P
                  ! 4       pV P                  P                  V4      pVP                  V P                   4      pV# )z6Returns list of packages what tracer should care about)	specified_packagesnowr   	timestampr   Z	boot_timer   Zpackages_newer_thanZintersection)r   r   packagess   &  r   _modified_packagesZTracer._modified_packagesM   st    	
T44
55 $dnnF4D4D4F)""66yA(""4#:#:;(	/r   c           
     s   V P                  V4      pV P                  4       p/ p. pVP                  4        EF  pV P                  P	                  VP
                  4       EF  p\        P                  ! V4      pWr9   g   K"  W',           EF  pVP                  V9   d   K   VP                  4       VP                  8:  EdZ   VP                  VP                  4       V P                  V4      pV P                  P                  VP                  4       4      p	V	P                  '       g   V	P
                  V9  d   V P                   '       d>   V P                  P#                  V	4      '       g   \$        P&                  R,          V	n        \+        V	P,                  4      WIP
                  &   \/        4       WIP
                  ,          n        V P3                  WIP
                  ,          4       WIP
                  ,          P0                  P                  V4       EK  EK  EK  	  EK  	  EK  	  V P                  P                  R4      P                  '       gI   V P7                  4       '       d3   \+        RRR\$        P&                  R,          R\9        R4      /4      VR&   \;        VP=                  4       4      #   \4         d     EK;  i ; i)z
Returns collection of applications which uses some files that have been modified
@TODO This function should be hardly optimized
ZERASEDZkernelnametypeZSTATICZhelperz%You will have to reboot your computer)r   r   Zunique_newestr   package_filesr   r   strippidcreate_timemodifiedZappend_apply_rulesr   findZignorer   Zprovided_byr
   ZTYPESr    r   Z_attributesr   Zaffected_instances
_call_hookr   _has_updated_kernelr   r   Zvalues)
r   Zuserr   r   affectedZfoundpackageZfileZpZas
   &&        r   trace_affectedZTracer.trace_affectedW   s    <<&$$&((
%'')g$$227<<@t  &D>\\		
G,,	,||AEEQq""1668,qhhh66!LLL!6!6!B!B1!E!E%%h/!&/>&&	/J/L&&		,	&&)	*++2215  
-  A *8 
			 	 	*	1	1	1d6N6N6P6P+VXv|GYGYZbGc	1<=-? @8H 
  1	22  
s&   !BJ5("J5 J5,B(J55K	K	c                s    \         P                  ! 4       pVf    R# \         P                  ! 4       p\        V4      pVP	                  V P
                  4       V P
                  P                  W4      R8H  # )NFi)r   Zrunning_kernel_packagekernel_package_namer   Z	load_infor   Zcompare_packages)r   Zrunningr-   Zlatests   &   r   r)   ZTracer._has_updated_kernel   se    ))+'_G
224&'&4(()				/	/	@B	FFr   c                s   VP                  4       pV'       g   V# V P                  P                  VP                  4       4      pV P                  P                  VP                  4       4      pV'       d/   VP                  V P                  P
                  R ,          8X  d   V# V'       d   VP                  '       g   V# VP                  V P                  P
                  R,          8X  d   V P                  V4      # V# )ZRETURNzCALL-PARENT)parentr   r'   r   ZactionZACTIONSr&   )r   processr.   Zc_ruleZp_rules   &&   r   r&   ZTracer._apply_rules   s    >>&	
>;;GLLN+&;;FKKM*&!4!4X!>>
>	v}}}
>]]dkk))-88


F
## 
-r   c                sd    V P                   '       d   V P                  VP                  4       R # R # r   )r   r   )r   apps   &&r   r(   ZTracer._call_hook   s%    	! r   c                s    V P                  4       p\        4       pVP                   FE  pVP                  V P	                  WSV4      4       VP                  V P                  WSV4      4       KG  	  V# )z
Returns collection of processes where each of them contains
packages which affected it. Packages contains only files matching
with the particular process
)r   r   Z	instancesupdate_affecting_processes_affecting_children)r   r0   affected_process_factoryr   	processesr/   s   &&&   r   trace_applicationZTracer.trace_application   sh     $$&()+)gD--gAYZ[D,,W@XYZ  
r   c                sB   \        4       pVP                  pV EF  p\        4       pV P                  P	                  VP
                  4       FS  p\        P                  ! V4      pW9   g   K!  VP                  4       VP                  8:  g   KB  VP                  V4       KU  	  V'       g   K  Tp	Wyn        V! VP                  4      p
V
P                  P                  VP                  4       V
P                  P                  V	.4       VP                  V
.4       EK  	  V# r   )r   ZfilesZsetr   r!   r   r   r"   r$   r%   Zaddr#   Z__dict__r1   r   )r   r/   r   r4   Z
collectionZprocess_filesr+   Zmatching_filesZpackage_fileZaff_pkgr*   s   &&&&       r   r2   ZTracer._affecting_processes   s    *,*---gE>,,::7<<H|"((6L( 0 00% I nG"M'4HW--.gY'xj!# $ 
r   c                s.   V P                   P                  VP                  4       4      '       g   / # \        4       pVP	                  4        FE  pVP                  V P                  WRV4      4       VP                  V P                  WRV4      4       KG  	  V# r   )r   r'   r   r   Zchildrenr1   r2   r3   )r   r/   r   r4   r5   Zchilds   &&&&  r   r3   ZTracer._affecting_children   s}    			',,.	)	)
9)+)!eD--e?WXYD,,U>VWX " 
r   )r   r   r   r   r   r   )NNFr   )Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__r   r   r   r   r   r   r   r   r   r   r   r,   r)   r&   r(   r   r6   r2   r3   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r   !   s     @2  9kZ
<3	,3\G*" <K  M\ . r   r   )Z
__future__r    ZosZpsutilr   Ztracer.resources.packager   Ztracer.resources.systemr   Z tracer.resources.FilenameCleanerr   Ztracer.resources.processesr   Ztracer.resources.collectionsr   r   r   Ztracer.resources.exceptionsr	   Ztracer.resources.applicationsr
   r   Ztracer.resources.langr   Zobjectr   ) r   r   <module>r7      s9   & ' 	   , * < 6 p p ? K #vV vr   