o k`O @sddlZddlZddlZddlZzddlmZWn!ey9zddlmZWn ey2dZYnwddZYnwddZej dkZ d d Z dS) N)crypt) des_cryptcCs*ttdrtj|d|Stj||dS)Nhash)salt)hasattrrusingrencrypt)secretrr 2/usr/lib/python3/dist-packages/trac/util/compat.pyrs rcCs ||S)N) rpartition)ssepr r r r 's r ntc Csddlm}z)t|j}|||t|jkr-td|||t|jksWdSWdStyJ}z|jtj kr>nWYd}~dSd}~ww)aIThis function is typically called before a file save operation, waiting if necessary for the file modification time to change. The purpose is to avoid successive file updates going undetected by the caching mechanism that depends on a change in the file modification time to know when the file should be reparsed.r) touch_filegMbP?N) trac.utilrosstatst_mtimetimesleepOSErrorerrnoENOENT)filenamermtimeer r r wait_for_file_mtime_change/s    r) rr subprocessrr ImportError passlib.hashrr name close_fdsrr r r r s$