Moved gui.thumbnails to gen.utils: useful without gui

This commit is contained in:
Doug Blank 2015-08-13 17:57:19 -04:00
parent b4a5fc91f0
commit 134ba5bf2e
13 changed files with 18 additions and 14 deletions

View File

@ -36,10 +36,15 @@ from hashlib import md5
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
from gi.repository import Gtk
from gi.repository import GObject
from gi.repository import GdkPixbuf
try:
from gi.repository import Gtk
_icon_theme = Gtk.IconTheme.get_default()
except:
_icon_theme = None
#-------------------------------------------------------------------------
#
# gramps modules
@ -220,7 +225,6 @@ def __create_thumbnail_image(src_file, mtype=None, rectangle=None,
# find_mime_type_pixbuf
#
#-------------------------------------------------------------------------
_icon_theme = Gtk.IconTheme.get_default()
def find_mime_type_pixbuf(mime_type):
try:

View File

@ -55,7 +55,7 @@ from gramps.gen.config import config
from gramps.gen.utils.file import (media_path_full, media_path, relative_path,
find_file)
from gramps.gen.mime import get_type
from ..thumbnails import find_mime_type_pixbuf
from gramps.gen.utils.thumbnails import find_mime_type_pixbuf
from ..display import display_help
from ..managedwindow import ManagedWindow
from ..dialog import ErrorDialog, WarningDialog

View File

@ -54,7 +54,7 @@ from gramps.gen.lib import MediaObject, MediaRef
from gramps.gen.db import DbTxn
from gramps.gen.utils.file import (media_path_full, media_path, relative_path,
create_checksum)
from ...thumbnails import get_thumbnail_image
from gramps.gen.utils.thumbnails import get_thumbnail_image
from gramps.gen.errors import WindowActiveError
from gramps.gen.mime import get_type, is_valid_type
from ...ddtargets import DdTargets

View File

@ -47,7 +47,7 @@ from ..utils import open_file_with_default_application
from gramps.gen.lib import MediaObject, NoteType
from gramps.gen.db import DbTxn
from gramps.gen.mime import get_description, get_type
from ..thumbnails import get_thumbnail_image, find_mime_type_pixbuf
from gramps.gen.utils.thumbnails import get_thumbnail_image, find_mime_type_pixbuf
from gramps.gen.utils.file import (media_path_full, find_file, create_checksum)
from .editprimary import EditPrimary
from ..widgets import (MonitoredDate, MonitoredEntry, PrivacyButton,

View File

@ -49,7 +49,7 @@ from gramps.gen.constfunc import conv_to_unicode
from ..utils import open_file_with_default_application
from gramps.gen.const import THUMBSCALE
from gramps.gen.mime import get_description, get_type
from ..thumbnails import get_thumbnail_image, find_mime_type_pixbuf
from gramps.gen.utils.thumbnails import get_thumbnail_image, find_mime_type_pixbuf
from gramps.gen.utils.file import (media_path_full, find_file, create_checksum)
from gramps.gen.lib import NoteType
from gramps.gen.db import DbTxn

View File

@ -51,7 +51,7 @@ from gi.repository import Pango
#
#-------------------------------------------------------------------------
from gramps.gen.utils.file import media_path_full
from ..thumbnails import get_thumbnail_image
from gramps.gen.utils.thumbnails import get_thumbnail_image
from ..utils import is_right_click, open_file_with_default_application
from gramps.gen.utils.db import get_birth_or_fallback
from gramps.gen.lib import NoteType, Person, Surname

View File

@ -45,7 +45,7 @@ from gi.repository import Gtk
#-------------------------------------------------------------------------
from gramps.gen.const import THUMBSCALE
from gramps.gen.utils.file import media_path_full
from ..thumbnails import get_thumbnail_image
from gramps.gen.utils.thumbnails import get_thumbnail_image
from ..views.treemodels import MediaModel
from .baseselector import BaseSelector

View File

@ -31,7 +31,7 @@ from gi.repository import Gtk
# Gramps modules
#
#-------------------------------------------------------------------------
from ..thumbnails import get_thumbnail_image, SIZE_NORMAL, SIZE_LARGE
from gramps.gen.utils.thumbnails import get_thumbnail_image, SIZE_NORMAL, SIZE_LARGE
from ..utils import is_right_click, open_file_with_default_application
from ..widgets.menuitem import add_menuitem
from gramps.gen.const import GRAMPS_LOCALE as glocale

View File

@ -51,7 +51,7 @@ from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
from gramps.gen.lib import EventRoleType, EventType, Person, PlaceType
from gramps.gen.utils.file import media_path_full
from gramps.gui.thumbnails import get_thumbnail_path
from gramps.gen.utils.thumbnails import get_thumbnail_path
from gramps.gen.plug.report import Report
from gramps.gen.plug.report import utils as ReportUtils
from gramps.gen.plug.report import MenuReportOptions

View File

@ -56,7 +56,7 @@ from gramps.gen.plug.report import MenuReportOptions
from gramps.gen.plug.report import stdoptions
from gramps.gen.lib import ChildRefType, EventRoleType, EventType
from gramps.gen.utils.file import media_path_full, find_file
from gramps.gui.thumbnails import get_thumbnail_path
from gramps.gen.utils.thumbnails import get_thumbnail_path
from gramps.gen.relationship import get_relationship_calculator
from gramps.gen.utils.db import get_birth_or_fallback, get_death_or_fallback
from gramps.gen.display.place import displayer as place_displayer

View File

@ -57,7 +57,7 @@ from gramps.gen.utils.alive import probably_alive
from gramps.gen.utils.file import media_path_full
from gramps.gen.utils.db import find_children, find_parents, find_witnessed_people
from gramps.gen.utils.libformatting import FormattingHelper
from gramps.gui.thumbnails import get_thumbnail_path
from gramps.gen.utils.thumbnails import get_thumbnail_path
from gramps.gen.errors import WindowActiveError
from gramps.gui.editors import EditPerson, EditFamily
from gramps.gui.ddtargets import DdTargets

View File

@ -69,7 +69,7 @@ from gramps.gen.utils.file import media_path_full
from gramps.gen.utils.alive import probably_alive
from gramps.gui.utils import open_file_with_default_application
from gramps.gen.datehandler import displayer, get_date
from gramps.gui.thumbnails import get_thumbnail_image
from gramps.gen.utils.thumbnails import get_thumbnail_image
from gramps.gen.config import config
from gramps.gui import widgets
from gramps.gui.widgets.reorderfam import Reorder

View File

@ -121,7 +121,7 @@ from gramps.gen.utils.alive import probably_alive
from gramps.gen.utils.db import get_source_and_citation_referents
from gramps.gen.constfunc import win, conv_to_unicode, get_curr_dir
from gramps.gen.config import config
from gramps.gui.thumbnails import get_thumbnail_path, run_thumbnailer
from gramps.gen.utils.thumbnails import get_thumbnail_path, run_thumbnailer
from gramps.gen.utils.image import image_size, resize_to_jpeg_buffer
from gramps.gen.mime import get_description
from gramps.gen.display.name import displayer as _nd