| Home | Trees | Indices | Help |
|
|---|
|
|
Utilities, the stable ones are the following:
* h_file: compute a unique value for a file (hash), it uses
the module fnv if it is installed (see waf/utils/fnv & http://code.google.com/p/waf/wiki/FAQ)
else, md5 (see the python docs)
For large projects (projects with more than 15000 files) it is possible to use
a hashing based on the path and the size (may give broken cache results)
import stat
def h_file(filename):
st = os.stat(filename)
if stat.S_ISDIR(st[stat.ST_MODE]): raise IOError, 'not a file'
m = md5()
m.update(str(st.st_mtime))
m.update(str(st.st_size))
m.update(filename)
return m.digest()
To replace the function in your project, use something like this:
import Utils
Utils.h_file = h_file
* h_list
* h_fun
* get_term_cols
* ordered_dict
|
|||
| WafError | |||
| WscriptError | |||
| ordered_dict | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
indicator = sys.platform== 'win32' and '\x1b[A\x1b[K%s%s%s\r'
|
|||
g_loaded_modules = {}index modules by absolute path |
|||
g_module = Nonethe main module is special |
|||
rot_idx = 0
|
|||
rot_chr = ['\\', '|', '/', '-']the rotation thing |
|||
_quote_define_name_translation = Nonelazily construct a translation table for mapping invalid characters to valid ones |
|||
_hash_blacklist_types = types.BuiltinFunctionType, types.Modul
|
|||
reg_subst = re.compile(r"(\\\\)|(\\\$)|\$\{([^}]+)\}")
|
|||
|
|||
hash a function (object) and the global vars needed from outside ignore unhashable global variables (lists) prevhash: previous hash value to be combined with this one; if there is no previous value, zero should be used here func: a Python function object. |
|
|||
indicator
|
_hash_blacklist_types
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Sun Aug 3 22:22:49 2008 | http://epydoc.sourceforge.net |