def _get_configspec():
"""Found and read all the configuration specifications"""
files = sorted(pkg_resources.resource_listdir(__name__, ""))
specfiles = [fn for fn in files if fn.endswith(".conf.spec")]
if os.environ.get("DEBUG_FG21SIM"):
print("DEBUG: Found config specifications: %s" % ", ".join(specfiles),
file=sys.stderr)
# NOTE:
# `resource_string()` returns the resource in *binary/bytes* string
configspec = "\n".join([
pkg_resources.resource_string(__name__, fn).decode("utf-8")
for fn in specfiles
]).split("\n")
return configspec
评论列表
文章目录