diff options
| author | David Bremner <david@tethera.net> | 2021-07-31 13:13:22 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2021-07-31 13:13:22 -0300 |
| commit | 7a46a51e47c2b37aae32f4bea06a8cedaa179850 (patch) | |
| tree | d0b6f622e13799da82b8c016f8792fbf6000c6e6 /mm3mod | |
| parent | 76248b6ef763739ed24eb55171b26f343e69f845 (diff) | |
read configuration
Diffstat (limited to 'mm3mod')
| -rw-r--r-- | mm3mod/__init__.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/mm3mod/__init__.py b/mm3mod/__init__.py index c95d3e8..44e6744 100644 --- a/mm3mod/__init__.py +++ b/mm3mod/__init__.py @@ -1,2 +1,15 @@ +import configparser +from xdg import xdg_config_home +from pathlib import PurePath + def main (): - print("hello world") + + config_path = PurePath (xdg_config_home (), 'mm3mod', 'config.ini') + config = configparser.ConfigParser () + with open(config_path) as f: + config.read_file (f) + + print("user =", config.get('rest','user')) + +if __name__ == "__main__": + main() |
