Skip to content
Snippets Groups Projects
Commit dd41834f authored by David Huss's avatar David Huss :speech_balloon:
Browse files

Fix error in readme, remove mentions of eigenservice in help)

parent 10861a1c
No related branches found
No related tags found
No related merge requests found
# common-config
This is a common configuration library for eigenservice
This is a common configuration library for python based services
Add this dependency to your application e.g. using poetry (ssh-add so you don't have to type the ssh-password over and over):
Add this dependency to your application e.g. using poetry:
```bash
ssh-add
poetry add git+ssh://git@code.hfbk.net:4242/id/eigenservice/common-config.git -vvv
poetry add git+https://code.hfbk.net/id/eigenservice/common-config.git
```
When something changes update it like this:
......@@ -25,7 +24,7 @@ Then in the application use something like this as a starting point:
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import common_config
from common_config import initialize_config, read_settings, main
from common_config import initialize_config, read_config
# Name of this application, used in directory names, etc
APPLICATION_NAME = "my_application"
......@@ -48,7 +47,7 @@ common_config.common.DEFAULT_CONFIG = DEFAULT_CONFIG
if __name__ == "__main__":
main()
common_config.main()
```
If people now run that file, they will get an interactive configuration-tool
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import inspect
import os, getpass, sys
import subprocess
import os
import sys
import getpass
import logging
import toml
from pathlib import Path
......@@ -38,10 +39,10 @@ def get_config_directories() -> List[dict]:
Existence of the directories is _not_ checked
"""
# Generate a etc directory (usually /etc/eigenservice)
# Generate a etc directory (e.g. /etc/my_service_name)
etc_directory = f"/etc/{APPLICATION_NAME}"
# Get the default config dir (usually /home/user/.config/eigenservice)
# Get the default config dir (e.g. /home/user/.config/my_service_name)
default_config_home = f"{get_home()}/.config/{APPLICATION_NAME}"
# Unless the XDG_CONFIG_HOME environment variable has been set, then use this instead
......@@ -380,8 +381,8 @@ def create_config():
"""
helptext = f"""Configs are read from the following directories (later overrides earlier):
1. DEFAULT_CONFIG (use config default to inspect)
2. /etc/eigenservice/*{SUFFIX}.toml (in alphabetical order)
3. $XDG_CONFIG_HOME/eigenservice/*{SUFFIX}.toml (in alphabetical order)
2. /etc/{APPLICATION_NAME}/*{SUFFIX}.toml (in alphabetical order)
3. $XDG_CONFIG_HOME/{APPLICATION_NAME}/*{SUFFIX}.toml (in alphabetical order)
4. $EIGENSERVICE_CONFIG_DIR/*{SUFFIX}.toml (in alphabetical order)
5. $EIGENSERVICE_CONFIG_PATH (final override)
"""
......@@ -509,12 +510,12 @@ def print_help():
"""
helptext = f"""========= {APPLICATION_NAME.upper()} CONFIG ({SUFFIX.upper()}) =========
Helper tool for managing and installing a eigenservice config.
Helper tool for managing and installing a {APPLICATION_NAME} config.
Configs are read from the following directories (later overrides earlier):
1. DEFAULT_CONFIG (see below)
2. /etc/eigenservice/*{SUFFIX}.toml (in alphabetical order)
3. $XDG_CONFIG_HOME/eigenservice/*{SUFFIX}.toml (in alphabetical order)
2. /etc/{APPLICATION_NAME}/*{SUFFIX}.toml (in alphabetical order)
3. $XDG_CONFIG_HOME/{APPLICATION_NAME}/*{SUFFIX}.toml (in alphabetical order)
4. $EIGENSERVICE_CONFIG_DIR/*{SUFFIX}.toml (in alphabetical order)
5. $EIGENSERVICE_CONFIG_PATH (final override)
......
[tool.poetry]
name = "common-config"
version = "0.1.18"
description = "A config library for eigenservice"
version = "0.1.19"
description = "A config library for python based services"
authors = ["David Huss <dh@atoav.com>"]
[tool.poetry.dependencies]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment