Commit cf013035 authored by M. Huang's avatar M. Huang
Browse files

getConfig uses pns.config as defalt

parent 48ef121e
# -*- coding: utf-8 -*-
from ..pns.config import pnsconfig as builtin_conf
from os.path import join, expanduser, expandvars, isdir
import functools
import sys
......@@ -33,13 +35,13 @@ def getConfig(name=None, conf='pns'):
""" Imports a dict named [conf]config.
The contents of the config are defined in the ``.config/[conf]local.py`` file. The contenss are used to update defaults in ``fdi.pns.config``.
Th config file is given by the environment variable ``CONF_DIR``, which if not given or pointing to an existing directly is process owner's ``~/.config`` directory.
Th config file directory can be modified by the environment variable ``CONF_DIR``, which if not given or pointing to an existing directly is process owner's ``~/.config`` directory.
name: if given the poolurl in ``poolurl_of`` is returned, else construct a poolurl from the contents in dict <conf>config.
conf: configuration ID. default 'pns', so the file is 'pnslocal.py'.
"""
# default configuration is provided. Copy pns/config.py to ~/.config/pnslocal.py
config = {}
config = builtin_conf
epath = expandvars('$CONF_DIR')
if isdir(epath):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment