Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 292055
Collapse All | Expand All

(-)mirage-0.9.3.orig/mirage.py (-2 / +11 lines)
Lines 29-35 Link Here
29
import os, sys, getopt, ConfigParser, string, gc
29
import os, sys, getopt, ConfigParser, string, gc
30
import random, urllib, gobject, gettext, locale
30
import random, urllib, gobject, gettext, locale
31
import stat, time, subprocess, shutil, filecmp
31
import stat, time, subprocess, shutil, filecmp
32
import tempfile, socket, md5, threading
32
import tempfile, socket, threading
33
try:
34
	import hashlib
35
	HAS_HASHLIB = True
36
except:
37
	HAS_HASHLIB= False
38
	import md5
33
try:
39
try:
34
	import imgfuncs
40
	import imgfuncs
35
	HAS_IMGFUNCS = True
41
	HAS_IMGFUNCS = True
Lines 873-879 Link Here
873
	def thumbnail_get_name(self, image_name):
879
	def thumbnail_get_name(self, image_name):
874
		filename = os.path.expanduser('file://' + image_name)
880
		filename = os.path.expanduser('file://' + image_name)
875
		uriname = os.path.expanduser('file://' + urllib.pathname2url(image_name))
881
		uriname = os.path.expanduser('file://' + urllib.pathname2url(image_name))
876
		m = md5.new()
882
		if HAS_HASHLIB:
883
		    m = hashlib.md5()
884
		else:
885
		    m = md5.new()
877
		m.update(uriname)
886
		m.update(uriname)
878
		mhex = m.hexdigest()
887
		mhex = m.hexdigest()
879
		mhex_filename = os.path.expanduser('~/.thumbnails/normal/' + mhex + '.png')
888
		mhex_filename = os.path.expanduser('~/.thumbnails/normal/' + mhex + '.png')

Return to bug 292055