From 0b4e1f2b412ad236c271b8f77cb0007dd091d4c3 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Thu, 17 May 2012 14:04:09 +0200 Subject: Fix the "No such file or directory" logo bug --- lib/mat.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/mat.py b/lib/mat.py index 9196ed2..59f6058 100644 --- a/lib/mat.py +++ b/lib/mat.py @@ -31,16 +31,16 @@ LOGGING_LEVEL = logging.DEBUG logging.basicConfig(filename=fname, level=LOGGING_LEVEL) -def get_sharedir(): +def get_sharedir(filename): ''' - An ugly hack to find where is the "FORMATS" file. + An ugly hack to find various files ''' - if os.path.isfile('FORMATS'): + if os.path.exists(os.path.join('/usr/local/share/mat/', filename)): + return os.path.join('/usr/local/share/mat/', filename) + elif os.path.exists(os.path.join('/usr/share/mat/', filename)): + return os.path.join('/usr/share/mat', filename) + elif os.path.isfile('FORMATS'): return '.' - elif os.path.exists('/usr/local/share/mat/'): - return '/usr/local/share/mat/' - elif os.path.exists('/usr/share/mat/'): - return '/usr/share/mat' class XMLParser(xml.sax.handler.ContentHandler): -- cgit v1.3