credentials helper funcions.
returnd credendtials.py as a module.
# fbf/utils/creds.py # # """ credentials helper funcions. """ # fbf feedback from fbf.lib.fbfimport import import_byfile from fbf.lib.datadir import getdatadir from fbf.lib.errors import RequireError
import os import logging
def getcredsmod(datadir=None, doraise=False): """ returnd credendtials.py as a module. """ if not datadir: datadir = getdatadir() try: mod = import_byfile("credentials", datadir + os.sep + "config" + os.sep + "credentials.py") global go go = True except (IOError, ImportError): if doraise: raise RequireError("credentials.py is needed in %s/config dir. see %s/examples" % (datadir, datadir)) else: logging.warn("credentials.py is needed in %s/config dir. see %s/examples" % (datadir, datadir)) return logging.warn("found %s credentials" % str(mod)) return mod