#!/usr/bin/env python import os import sys def get_language(): ret="es" lang=os.environ["LANG"] if "es_ES" in lang or "es." in lang: ret="es" if "ca_ES" in lang: ret="ca_ES@valencia" return ret #def get_language try: PATH="/usr/share/lliurex-doc/pdf/%s/" DEFAULT_LANG="es" lang=get_language() f=PATH%lang f+="/"+sys.argv[1] if not os.path.exists(f): f=PATH%DEFAULT_LANG f+=sys.argv[1] cmd="evince %s"%f print cmd os.system(cmd) except: print "Unknown file"