import os import ConfigParser rsrc_path=None def get_rsrc(): global rsrc_path #print(os.getcwd()) if os.path.exists(os.getcwd()+"/../rsrc"): rsrc_path=os.getcwd()+"/../rsrc/" else: rsrc_path="/usr/share/lliurex-amic/rsrc/" print "[Resources] rsrc:" + rsrc_path return rsrc_path def get_images(): return "/usr/share/lliurex-amic/resources/images/" def get_audios(): return "/usr/share/lliurex-amic/resources/audios/" def get_grids(): return "/usr/share/lliurex-amic/grids/" class Resources: cfg=None def __init__(self): if Resources.cfg==None: Resources.cfg=ConfigParser.ConfigParser() Resources.cfg.read("/etc/lliurex-amic/amic.conf") def get_rsrc(self): return "/usr/share/lliurex-amic/rsrc/" def get_images(self): return Resources.cfg.get("Amic.conf","dir_img") def get_custom_images(self): return Resources.cfg.get("Amic.conf","dir_img_custom") def get_audios(self): return Resources.cfg.get("Amic.conf","dir_audio") def get_grids(self): return Resources.cfg.get("Amic.conf","dir_grids") def get_custom_audios(self): return Resources.cfg.get("Amic.conf","dir_audio_custom")