From b3201048cd9712325082d9c9d8db28e9636c39a6 Mon Sep 17 00:00:00 2001 From: Andreas Hasenack Date: Fri, 18 Aug 2006 22:07:45 +0000 Subject: - ups, forgot get_helper --- RepSys/util.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/RepSys/util.py b/RepSys/util.py index 766d3c1..5612029 100644 --- a/RepSys/util.py +++ b/RepSys/util.py @@ -51,4 +51,18 @@ def get_auth(username=None, password=None): config.set("auth", "password", password) return username, password +def get_helper(name): + """Tries to find the path of a helper script + + It first looks if the helper has been explicitly defined in + configuration, if not, falls back to the default helper path, which can + also be defined in configuration file(s). + """ + helperdir = config.get("helper", "prefix", "/usr/share/repsys") + hpath = config.get("helper", name, None) or \ + os.path.join(helperdir, name) + if not os.path.isfile(hpath): + log.warn("providing unexistent helper: %s", hpath) + return hpath + # vim:et:ts=4:sw=4 -- cgit v1.2.1