def get_conf_options(args, OSX): config = get_conf_file(args) xselpath = config.get_value("Global", "xsel") if not xselpath: set_xsel(config, OSX) set_win_colors(config) set_db(args) set_umask(config) set_algorithm(args, config) dbtype = config.get_value("Database", "type") if not dbtype: raise Exception("Could not read the Database type from the config!") return xselpath, dbtype
def get_db_version(config, dbtype, args): if os.path.exists(config.get_value("Database", "filename")): dbver = data.factory.check_db_version(dbtype) if dbver < 0.4 and not args.dbconvert: print(_db_warn) else: dbver = __DB_FORMAT__ return dbver
def set_umask(config): umask = config.get_value("Global", "umask") if re.search(r'^\d{4}$', umask): os.umask(int(umask)) else: raise config.ConfigException("Could not determine umask from config!")