bmaptool: assign user-friendly names to file objects
Just like many things in python, BmapCopy assumes that file-like objects'
'name' attribute contains something user-frienly. And this is the case in most
of the cases, except one case. If the file object was created using
'os.fdopen()', the name will be '<fdopen>', instead of something user-friendly.
And bmaptool uses 'os.fdopen()' when opening block devices, because we need to
use special open flags. This results in poor error messages like this:
bmaptool: ERROR: wrote 187980 blocks from image
'ivi-wayland-tizen-2.0a_20130501.1-sdb.raw.bz2' to '<fdopen>' ...
And the problem is that you cannot change the name - it is a read-only
attribute. This problem will probably be resolved in python 3, but not in 2.x,
see http://bugs.python.org/issue1625576
This patch works-around the problem by creating own simple dummy class which
overrides the name.
Change-Id: Ia6c8565c414c5e57d294d83c0fe5758e7b5aa518
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>