diff --git a/src/wireviz/Harness.py b/src/wireviz/Harness.py index 29d0e0b..1c62052 100644 --- a/src/wireviz/Harness.py +++ b/src/wireviz/Harness.py @@ -328,6 +328,26 @@ class Harness: return bytes(string, encoding='utf-8') + @property + def csv(self): + raise NotImplementedError + + @property + def csv_excel(self): + raise NotImplementedError + + @property + def csv_unix(self): + raise NotImplementedError + + @property + def tsv(self): + raise NotImplementedError + + @property + def tsv_excel(self): + raise NotImplementedError + def output(self, filename: (str, Path), view: bool = False, cleanup: bool = True, fmt: tuple = ('pdf', )) -> None: # graphical output graph = self.create_graph() diff --git a/src/wireviz/wireviz.py b/src/wireviz/wireviz.py index e6aed08..6d3fcec 100755 --- a/src/wireviz/wireviz.py +++ b/src/wireviz/wireviz.py @@ -179,12 +179,24 @@ def parse(yaml_input: str, file_out: (str, Path) = None, return_types: (None, st for rt in return_types: if rt == 'png': returns.append(harness.png) - if rt == 'svg': + elif rt == 'svg': returns.append(harness.svg) - if rt == 'html': + elif rt == 'html': returns.append(harness.html) - if rt == 'harness': + elif rt == 'csv': + returns.append(harness.csv) + elif rt == 'csv_excel': + returns.append(harness.csv_excel) + elif rt == 'csv_unix': + returns.append(harness.csv_unix) + elif rt == 'tsv': + returns.append(harness.tsv) + elif rt == 'tsv_excel': + returns.append(harness.tsv_excel) + elif rt == 'harness': returns.append(harness) + else: + raise ValueError(f'return type "{rt}" not supported') return tuple(returns) if len(returns) != 1 else returns[0] @@ -208,7 +220,9 @@ def parse_file(yaml_file: str, file_out: (str, Path) = None) -> None: def main(input_file, prepend, out): """ Take a YAML file containing a harness specification and, utilizing GraphViz, - translate that specification into various output formats. Example: + translate that specification into various output formats. + + Example: $>wireviz my_input_file.yml -o png -o svg """