summaryrefslogtreecommitdiff
path: root/MAT/mat.py
diff options
context:
space:
mode:
authorjvoisin2013-01-07 22:37:54 +0100
committerjvoisin2013-01-07 22:37:54 +0100
commit5027bba6c2c1c7546cfc0eb953de38181b7e4e7b (patch)
tree094928d07c06070c59fa10132fb67a07386a6405 /MAT/mat.py
parent27189a6f322f720803759daf2061b503e0148963 (diff)
Refactor the get_sharedir function, and move datas to a proper data folder
Diffstat (limited to 'MAT/mat.py')
-rw-r--r--MAT/mat.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/MAT/mat.py b/MAT/mat.py
index 7b5149f..b18cc63 100644
--- a/MAT/mat.py
+++ b/MAT/mat.py
@@ -30,19 +30,21 @@ LOGGING_LEVEL = logging.DEBUG
30 30
31logging.basicConfig(filename=fname, level=LOGGING_LEVEL) 31logging.basicConfig(filename=fname, level=LOGGING_LEVEL)
32 32
33def get_logo():
34 if os.path.isfile('./data/mat.png'):
35 return './data/mat.png'
36 elif os.path.isfile('/usr/share/pixmaps/mat.png'):
37 return '/usr/share/pixmaps/mat.png'
38 elif os.path.isfile('/usr/local/share/pixmaps/mat.png'):
39 return '/usr/local/share/pixmaps/mat.png'
33 40
34def get_sharedir(filename): 41def get_formats():
35 ''' 42 if os.path.isfile('./data/FORMATS'):
36 An ugly hack to find various files 43 return './data/FORMATS'
37 ''' 44 elif os.path.isfile('/usr/share/mat/FORMATS'):
38 if os.path.isfile(filename): 45 return '/usr/share/mat/FORMATS'
39 return filename 46 elif os.path.isfile('/usr/local/share/mat/FORMATS'):
40 elif os.path.exists(os.path.join('/usr/local/share/mat/', filename)): 47 return '/usr/local/share/mat/FORMATS'
41 return os.path.join('/usr/local/share/mat/', filename)
42 elif os.path.exists(os.path.join('/usr/share/mat/', filename)):
43 return os.path.join('/usr/share/mat', filename)
44 elif os.path.exists(os.path.join('/usr/local/share/pixmaps/', filename)):
45 return os.path.join('/usr/local/share/pixmaps/', filename)
46 48
47 49
48class XMLParser(xml.sax.handler.ContentHandler): 50class XMLParser(xml.sax.handler.ContentHandler):