Hook up mime.get_for_file

This commit is contained in:
Marco Pesenti Gritti
2007-05-24 12:30:42 +02:00
parent 2145de1039
commit 27a3644dab
6 changed files with 72 additions and 7 deletions
+11 -2
View File
@@ -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])