diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2018-08-05 21:16:54 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2018-08-05 21:16:54 +0200 |
commit | 13032164ccfb479b432c0a2e8085c09983349fea (patch) | |
tree | 88c790385e942d862f388de30aa7a6d23ae25971 /src/ee/ds | |
parent | 46695e31f2535fbb0c8b0d3989fb365f8e3456ed (diff) | |
download | ee-python-fact.tar.gz ee-python-fact.tar.bz2 ee-python-fact.tar.xz ee-python-fact.zip |
o Starting on some code for building reports from the project.fact
Diffstat (limited to 'src/ee/ds')
-rw-r--r-- | src/ee/ds/__init__.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ee/ds/__init__.py b/src/ee/ds/__init__.py index e543051..915dd6f 100644 --- a/src/ee/ds/__init__.py +++ b/src/ee/ds/__init__.py @@ -270,6 +270,11 @@ class DataSetManager(object): self._basedir = Path(basedir) self._csv = {} # type: MutableMapping[str, Tuple[str, Path]] + @property + def all_data_sets(self): + datasets = [ds.name for ds in self._basedir.iterdir() if (ds / "data-set.ini").is_file()] + return list(self._csv.keys()) + datasets + def cookie_for_ds(self, ds_name) -> Path: try: return self._csv[ds_name][1] @@ -314,7 +319,7 @@ class DataSetManager(object): @staticmethod def _load_csv(object_type: str, path: Path, freeze: bool) -> DataSet: - logger.debug("Loading CSV file {}".format(path)) + # logger.debug("Loading CSV file {}".format(path)) ds = DataSet() with open(str(path), newline='') as f: @@ -334,7 +339,7 @@ class DataSetManager(object): if freeze: ds.freeze() - logger.debug("Loaded {} objects".format(len(ds))) + # logger.debug("Loaded {} objects".format(len(ds))) return ds def _load_ini_dir(self, _path: str, freeze: bool) -> DataSet: |