svn: r6045
This commit is contained in:
Alex Roitman 2006-03-03 00:15:25 +00:00
parent bc6848cf20
commit 55c41ac2f8
2 changed files with 11 additions and 5 deletions

View File

@ -24,9 +24,11 @@ import gtk
import const import const
try: try:
from gnomevfs import mime_get_short_list_applications, mime_get_description, get_mime_type from gnomevfs import mime_get_short_list_applications, \
mime_get_description, get_mime_type
except: except:
from gnome.vfs import mime_get_short_list_applications, mime_get_description, get_mime_type from gnome.vfs import mime_get_short_list_applications, \
mime_get_description, get_mime_type
from gettext import gettext as _ from gettext import gettext as _
@ -58,7 +60,9 @@ def get_type(file):
return _('unknown') return _('unknown')
def mime_type_is_defined(type): def mime_type_is_defined(type):
""""Return True if a description for a mime type exists""" """
Return True if a description for a mime type exists.
"""
try: try:
mime_get_description(type) mime_get_description(type)
return True return True

View File

@ -1,7 +1,7 @@
# #
# Gramps - a GTK+/GNOME based genealogy program # Gramps - a GTK+/GNOME based genealogy program
# #
# Copyright (C) 2000-2004 Donald N. Allingham # Copyright (C) 2000-2006 Donald N. Allingham
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -57,7 +57,9 @@ def get_type(filename):
return _('unknown') return _('unknown')
def mime_type_is_defined(mime_type): def mime_type_is_defined(mime_type):
""""Return True if a description for a mime type exists""" """
Return True if a description for a mime type exists.
"""
return _type_map.has_key(mime_type) return _type_map.has_key(mime_type)
def find_mime_type_pixbuf(mime_type): def find_mime_type_pixbuf(mime_type):