- Internal cleanups: Remove an unnecessary scan argument. Associate
Scanners only with Builders, not nodes. Apply overrides once when a
- Builder is called, not in multiple places.
+ Builder is called, not in multiple places. Cache results from
+ the Node.FS.get_suffix() and Node.get_build_env() methods. Use
+ the Python md5 modules' hexdigest() method, if there is one.
- Use the correct scanner if the same source file is used for targets in
two different environments with the same path but different scanners.
h = string.hexdigits
r = ''
for c in s:
- i = ord(c)
- r = r + h[(i >> 4) & 0xF] + h[i & 0xF]
+ i = ord(c)
+ r = r + h[(i >> 4) & 0xF] + h[i & 0xF]
return r
+try:
+ a = md5.new('test').hexdigest()
+except AttributeError:
+ md5sig = lambda c: hexdigest(md5.new(str(c)).digest())
+else:
+ md5sig = lambda c: md5.new(str(c)).hexdigest()
+
+
def collect(signatures):
"""
Collect a list of signatures into an aggregate signature.
gc = obj.get_contents
except AttributeError:
raise AttributeError, "unable to fetch contents of '%s'" % str(obj)
- return hexdigest(md5.new(str(gc())).digest())
+ return md5sig(gc())
def to_string(signature):
"""Convert a signature to a string"""