Skip to content

Commit

Permalink
New function utils.list_cfgs()
Browse files Browse the repository at this point in the history
It returns a list of all QC procedures, the built-in plus the user local
collection.
  • Loading branch information
castelao committed Mar 12, 2020
1 parent 9fcea5b commit 7db6f42
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions cotede/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@
from .utils import cotederc


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.
"""
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"))
ucfg = [c[:-5] for c in ucfg if c[-5:] == ".json"]
ucfg = [c for c in ucfg if c not in cfg]

cfg.extend(sorted(ucfg))

return cfg


def inheritance(child, parent):
"""Aggregate into child what is missing from parent
"""
Expand Down

0 comments on commit 7db6f42

Please sign in to comment.