From 7cce4efc5aba2f1e868ee64fe647b2e0127995dc Mon Sep 17 00:00:00 2001 From: Guillaume Raffy Date: Fri, 6 Oct 2023 16:59:49 +0200 Subject: [PATCH] added documentation --- README.md | 12 ++++++++++++ create_list_for_annex.py | 7 ++++--- requirements.txt | 2 ++ 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 requirements.txt diff --git a/README.md b/README.md index e69de29..8771623 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,12 @@ + +## how to use + +```sh +graffy@graffy-ws2:~/work/convheb$ python -m venv convheb.venv +graffy@graffy-ws2:~/work/convheb$ source ./convheb.venv/bin/activate +(convheb.venv) graffy@graffy-ws2:~/work/convheb$ pip install requirements.txt +(convheb.venv) graffy@graffy-ws2:~/work/convheb$ python ./create_list_for_annex.py +``` + +note: cocluto can be found [here](https://git.ipr.univ-rennes1.fr/cellinfo/cocluto) + diff --git a/create_list_for_annex.py b/create_list_for_annex.py index 1a1983a..11e43c3 100644 --- a/create_list_for_annex.py +++ b/create_list_for_annex.py @@ -3,7 +3,7 @@ from cocluto.inventory import Inventory from cocluto.SimpaDbUtil import SqlDatabaseReader, SqlFile from urllib.parse import urlparse from abc import ABC, abstractmethod -from sys import stdout +# from sys import stdout import re @@ -157,9 +157,10 @@ def main(): machines_fqdn = get_hosted_machines_fqdn(inventory) print('ipr machines hosted at the dsi (%d):' % len(machines_fqdn)) - table_renderer = MarkdownTableRenderer() + table_renderer = TsvTableRenderer() - print_machine_table(machines_fqdn, inventory, stdout, table_renderer) + with open('ipr-machines-at-dsi.csv', 'wt') as tsv_file: + print_machine_table(machines_fqdn, inventory, tsv_file, table_renderer) if __name__ == '__main__': diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..9a022bd --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +cocluto==1.0 +mysqlclient==2.1.0