Add a new library to determine mime types

In order to determine file types by content rather than
extension, add a new library to autotest, magic.py, that
is based on the work of Jason Petrone. The advantage of
magic.py is that it doesn't depend on any external utility
or library. It exposes the public interface guess_type(),
that will match the data against a database of magic numbers.

Also, use the library to determine file contents on a
base_utils.py function.

Changes from v1:
 * Fixed some incorrect API usage documentation
 * Used optparse in the parser
 * Used the library in the other places of autotest that do need
   assessment of file contents.

Signed-off-by: Jean Parpaillon <jean.parpaillon@kerlabs.com>
Signed-off-by: Amos Kong <akong@redhat.com>
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4420 592f7852-d20e-0410-864c-8624ca9c26a4
2 files changed