summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-05-06 00:59:42 +0200
committerhut <hut@lavabit.com>2010-05-06 00:59:42 +0200
commit4de6abaf0ba5431395d2a627cddebdd86f10975f (patch)
tree59da7ba9d22b172dd18affd13da49dee47c96205
parent3566114b48177bbb6059344971775a5cdcd0357e (diff)
downloadranger-4de6abaf0ba5431395d2a627cddebdd86f10975f.tar.gz
shared.mimetype: optimization
-rw-r--r--ranger/shared/mimetype.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/ranger/shared/mimetype.py b/ranger/shared/mimetype.py
index 1a7f79a0..c6577056 100644
--- a/ranger/shared/mimetype.py
+++ b/ranger/shared/mimetype.py
@@ -17,9 +17,7 @@ from ranger import relpath
 import mimetypes
 class MimeTypeAware(object):
 	mimetypes = {}
-	__initialized = False
 	def __init__(self):
-		if not MimeTypeAware.__initialized:
-			MimeTypeAware.mimetypes = mimetypes.MimeTypes()
-			MimeTypeAware.mimetypes.read(relpath('data/mime.types'))
-			MimeTypeAware.__initialized = True
+		MimeTypeAware.__init__ = lambda _: None  # refuse multiple inits
+		MimeTypeAware.mimetypes = mimetypes.MimeTypes()
+		MimeTypeAware.mimetypes.read(relpath('data/mime.types'))