
    "d{                     :    d Z ddlmZmZ ddlZddlmZ ddZd Zy)z8Contains the fallback implementation of the Watcher api.    )absolute_importprint_functionN)	norm_pathc                 r   t         j                  j                  |       r,t        |       }|t         j                  j	                  |      iS t         j                  j                  |       si S i }t        t        |       j                  d            }t        j                  |       D ]  \  }}}t        |      }t        |j                  d            |z
  |k(  rg |dd t         j                  j	                  |      ||<   |D ]0  }t        ||      }t         j                  j	                  |      ||<   2  |S )z8Return a dict mapping files and folders to their mtimes./N)	ospathisfiler   getmtimeisdirlensplitwalk)	dir_or_filedepthr	   snapshot
base_depthrootsubdirsfilesfs	            ;/usr/lib/python3/dist-packages/qtsass/watchers/snapshots.pytaker      s   	ww~~k"%bgg&&t,--77==%	HY{+11#67J " 4 	4gutzz#*,5GAJ))$/ 	4AT1%DWW--d3HTN	4	4 O    c                     i }t        | j                               t        |j                               z  D ]3  }|| v r
||vrd||<   || vr
||v rd||<   | |   }||   }||kD  s/d||<   5 |S )z7Return a dict containing changes between two snapshots.DeletedCreatedChanged)setkeys)prev_snapshotnext_snapshotchangesr	   
prev_mtime
next_mtimes         r   diffr&   3   s    GM&&()C0B0B0D,EE 	*= T%>%GDM&4=+@%GDM&t,J&t,JJ& )	* Nr   )   )	__doc__
__future__r   r   r   qtsass.importersr   r   r&    r   r   <module>r,      s#    ? 7 
 '4r   