# Path: cotede/utils/utils.py
# def cotederc(subdir=None):
#     """Directory with custom configuration for CoTeDe
# 
#     To keep the local environment tight, CoTeDe expects to find all local files,
#     like pre-set QC procedures, in one single place. This function returns the
#     path to that directory.
# 
#     Parameters
#     ----------
#     subdir : str, optional
#         Sub-directory inside the base custom directory.
# 
#     Returns
#     -------
#     str
#         A path to the local custom files.
# 
#         The default path is a directory at the user's home like::
# 
#             ~/.config/cotederc/
# 
#     Note
#     ----
#     That default path can be modified by defining the environment variable
#     COTEDE_DIR. On bash that could be done like::
# 
#         export COTEDE_DIR='/my/other/awesome/path/'
# 
#     Note
#     ----
#     For windows users the path is automatically adjusted to reflect its
#     syntax.
# 
#     Example
#     -------
#     A sub-directory for configuration files, named 'cfg', can be determined by::
# 
#     >>> cotederc('cfg')
#     """
#     path = os.getenv("COTEDE_DIR", os.path.join("~", ".config", "cotederc"))
#     path = os.path.expanduser(path)
#     if subdir is not None:
#         path = os.path.join(path, subdir)
#     return path


from collections import OrderedDict
from .utils import cotederc
import copy
import json
import logging
import os.path
import pkg_resources
# -*- coding: utf-8 -*-

"""Resources related to QC configuration
"""



module_logger = logging.getLogger(__name__)


def list_cfgs():
    """List the available QC procedures, builtin + local

    Full QC procedures, defining which tests and respective parameters to be
    used, can be saved to be re-used later. Several procedures are built-in
    CoTeDe, but the user can create its own collection. This function returns
    a list of all procedures available, built-in + the local user collection.

    See also
    --------
    utils.load_cfg
    """
    cfg = pkg_resources.resource_listdir("cotede", "qc_cfg")
    cfg = sorted([c[:-5] for c in cfg if c[-5:] == ".json"])


# Path: cotede/utils/utils.py
# def cotederc(subdir=None):
#     """Directory with custom configuration for CoTeDe
# 
#     To keep the local environment tight, CoTeDe expects to find all local files,
#     like pre-set QC procedures, in one single place. This function returns the
#     path to that directory.
# 
#     Parameters
#     ----------
#     subdir : str, optional
#         Sub-directory inside the base custom directory.
# 
#     Returns
#     -------
#     str
#         A path to the local custom files.
# 
#         The default path is a directory at the user's home like::
# 
#             ~/.config/cotederc/
# 
#     Note
#     ----
#     That default path can be modified by defining the environment variable
#     COTEDE_DIR. On bash that could be done like::
# 
#         export COTEDE_DIR='/my/other/awesome/path/'
# 
#     Note
#     ----
#     For windows users the path is automatically adjusted to reflect its
#     syntax.
# 
#     Example
#     -------
#     A sub-directory for configuration files, named 'cfg', can be determined by::
# 
#     >>> cotederc('cfg')
#     """
#     path = os.getenv("COTEDE_DIR", os.path.join("~", ".config", "cotederc"))
#     path = os.path.expanduser(path)
#     if subdir is not None:
#         path = os.path.join(path, subdir)
#     return path


# Path: cotede/utils/config.py
from collections import OrderedDict
from .utils import cotederc
import copy
import json
import logging
import os.path
import pkg_resources

# -*- coding: utf-8 -*-

"""Resources related to QC configuration
"""



module_logger = logging.getLogger(__name__)


def list_cfgs():
    """List the available QC procedures, builtin + local

    Full QC procedures, defining which tests and respective parameters to be
    used, can be saved to be re-used later. Several procedures are built-in
    CoTeDe, but the user can create its own collection. This function returns
    a list of all procedures available, built-in + the local user collection.

    See also
    --------
    utils.load_cfg
    """
    cfg = pkg_resources.resource_listdir("cotede", "qc_cfg")
    cfg = sorted([c[:-5] for c in cfg if c[-5:] == ".json"])


    ucfg = os.listdir(cotederc("cfg"))