Package trac :: Package util :: Module compat

Module compat

source code

Various classes and functions to provide some backwards-compatibility with previous versions of Python from 2.6 onward.
Classes
  py_groupby
Use in templates as an alternative to itertools.groupby, which leaks memory for Python < 2.5.3.
Functions
 
rpartition(s, sep) source code
 
wait_for_file_mtime_change(filename)
This function is typically called before a file save operation, waiting if necessary for the file modification time to change.
source code
Variables
  close_fds = True
  __package__ = 'trac.util'

Imports: errno, math, os, time, cleandoc, des_crypt, crypt, all, any, frozenset, reversed, set, sorted, partial, md5, sha1, groupby, tee, OrderedDict


Function Details

wait_for_file_mtime_change(filename)

source code 
This 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.