From 4945f4e851fb0debbde6174a2e3d1f17eeca9e6c Mon Sep 17 00:00:00 2001 From: Sebastian Lobinger <sebastian.lobinger@zib.de> Date: Thu, 17 Aug 2017 14:06:55 +0200 Subject: [PATCH] update README.md fix issue #1 --- README.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 524c95f..0378b68 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,27 @@ Pyhton Konfigurationsklasse für YAML Dateien. ## Einbindung in andere Projekte Dieses Projekt ist selbst als python package Strukturiert und kann daher einfach -als git submodule direkt in andere Projekte eingebunden werden. \ No newline at end of file +als git submodule direkt in andere Projekte eingebunden werden. + +```bash +git submodule add git@git.imp.fu-berlin.de:coding-at-fu/yaml_config.git dict_filter +``` + +## Verwendung +Wurde das Projekt wie oben stehend eingebunden kann das Modul wie folgt verwendet werden: + +```python +from yaml_config import yaml_config + +config = yaml_config.YamlConfig(path = '/path/to/conf/file.yml') + +def do_whatever(): + config = yaml_config.YamlConfig.getInstance() + print (config.toDict().get('config_key')) + # wird foo ausgeben wenn config_key den Wert foo hat. + +def reconfigure(): + config = yaml_config.YamlConfig.getInstance() + config.reload() + # Die Konfiguration wurde neu eingelesen. +``` -- GitLab