def get_path(default, destination): if not utils.pathExists(destination): return utils.normalizePath(default) else: return utils.normalizePath(destination)
gtk.glade.bindtextdomain(I18N_APP, I18N_DIR) gtk.glade.textdomain(I18N_APP) gettext.install(I18N_APP, I18N_DIR, unicode=1) language = locale.setlocale(locale.LC_ALL, '') end = language.find('.') language = language[:end] #Folder for configurarion file CONFIG_DIR = utils.mkdir(os.path.expanduser('~/.aptoncd/')) #configuration file name CONFIG_FILE = os.path.join(CONFIG_DIR, 'config') #Local base path, where aptoncd is located (runtime) BASE_PATH = utils.normalizePath(os.curdir) MAIN_GUI = get_path('/usr/share/aptoncd/glade/main_window.glade', os.path.join(BASE_PATH ,'data/glade/main_window.glade')) CREATE_GUI = get_path('/usr/share/aptoncd/glade/create_window.glade', os.path.join(BASE_PATH ,'data/glade/create_window.glade')) RESTORE_GUI = get_path('/usr/share/aptoncd/glade/restore_window.glade', os.path.join(BASE_PATH ,'data/glade/restore_window.glade')) PROPERTY_GUI = get_path('/usr/share/aptoncd/glade/utils.glade', os.path.join(BASE_PATH ,'data/glade/utils.glade')) BURNS_DATA = get_path('/usr/share/aptoncd/burners', os.path.join(BASE_PATH ,'data/burners')) COPY_SCRIPT = get_path('/usr/share/aptoncd/restorefiles.py', os.path.join(BASE_PATH ,'restorefiles.py')) MAIN_ANIMATION = get_path('/usr/share/aptoncd/loading.gif', os.path.join(BASE_PATH,'data/loading.gif')) DESKTOP_FILE = get_path('/usr/share/applications/aptoncd.desktop', os.path.join(BASE_PATH,'data/aptoncd.desktop.in')) # documentation directory DOCDIR = get_path('doc/'+ language+ '/index.xml' , 'doc/'+ 'C/index.xml') #Configuration constants XML_FILE = os.path.join(CONFIG_DIR, 'conf.xml') XML_CONTENTS_FILE = 'content.xml'