From d72f23d08516ef5ac49fca2be0477097fddfe7e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Kervella?= Date: Thu, 24 May 2018 13:27:42 +0000 Subject: [PATCH] Basic API interaction --- config.ini | 4 ++++ main.py | 15 +++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 config.ini create mode 100644 main.py diff --git a/config.ini b/config.ini new file mode 100644 index 0000000..5a74f1f --- /dev/null +++ b/config.ini @@ -0,0 +1,4 @@ +[Re2o] +hostname = re2o-dev.rez-rennes.fr +username = moamoak +password = motdepasse diff --git a/main.py b/main.py new file mode 100644 index 0000000..b61dd95 --- /dev/null +++ b/main.py @@ -0,0 +1,15 @@ +from configparser import ConfigParser + +from re2oapi import Re2oAPIClient + +config = ConfigParser() +config.read('config.ini') + +hostname = config.get('Re2o', 'hostname') +password = config.get('Re2o', 'password') +username = config.get('Re2o', 'username') + +api_client = Re2oAPIClient(hostname, username, password) +extensions = api_client.list_extensions() + +print(len(extensions))