diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2007-05-24 10:30:42 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2007-05-24 10:30:42 (GMT) |
commit | 27a3644daba79f877d7528517d4e3a58da5c40fd (patch) | |
tree | 486cef8a8f57bb80b21a9201257a5f52e0a543db /tests | |
parent | 2145de103988086a6a0e72890b1104cd9c4a843e (diff) |
Hook up mime.get_for_file
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test-mime.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/test-mime.py b/tests/test-mime.py index f9b3ac2..a7f185e 100755 --- a/tests/test-mime.py +++ b/tests/test-mime.py @@ -16,6 +16,15 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -from sugar.objects import mime +import sys -print mime.get_from_file_name('test.pdf') +from sugar import objects + +print 'MIME type for test.pdf (from extension):' +print objects.mime.get_from_file_name('test.pdf') + +print '' + +if len(sys.argv) > 1: + print 'MIME type for file %s:' % sys.argv[1] + print objects.mime.get_for_file(sys.argv[1]) |