misc.py: make 'calc_hashes()' generic
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Wed, 24 Oct 2012 07:44:18 +0000 (10:44 +0300)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Mon, 5 Nov 2012 13:08:35 +0000 (15:08 +0200)
commit84ce3b5e4d2d438ef0fcaf5db300a7b21c6f1d98
tree368a93f1833d070f2e7d0a947b2c79f47ed85efa
parent211abc3ba595a6e7eb6359473576b1d6fc98dd49
misc.py: make 'calc_hashes()' generic

The 'calc_hashes()' function is generic so it does not make much sense
to hide it in the 'RawImageCreator' class. Move it to 'misc.py' where
miscellaneous stuff like this is kept.

While moving, also rename the 'file_name' argument to 'file_path'.

Also change the interface so that we pass a list of hash names to calculate,
not a list of hash objects.

Also do not import 'md5' from hashlib to the current name-spaces.

Note, originally I have these things as a set of separate patches, but
merged to satisfy review comments.

Change-Id: I31d8ac35cf55447ddb5c56cfafa319a6fef85373
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
mic/imager/raw.py
mic/utils/misc.py