From 51447751827e0fc36bd5060582b96f1136016649 Mon Sep 17 00:00:00 2001 From: David Erb Date: Tue, 28 Feb 2023 12:15:03 +0000 Subject: [PATCH] uses utilpack for envvar base --- src/dls_multiconf_lib/envvar.py | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/dls_multiconf_lib/envvar.py b/src/dls_multiconf_lib/envvar.py index 793983e..078afe3 100644 --- a/src/dls_multiconf_lib/envvar.py +++ b/src/dls_multiconf_lib/envvar.py @@ -1,32 +1,7 @@ -import logging -import os +from dls_utilpack.envvar import Envvar as DlsUtilpackEnvvar -logger = logging.getLogger(__name__) - -class Envvar: +class Envvar(DlsUtilpackEnvvar): """Class which covers environment variables, with default values.""" MULTICONF_CONFIGFILE = "MULTICONF_CONFIGFILE" - - def __init__(self, name, **kwargs): - - environ = kwargs.get("environ") - - if environ is None: - environ = os.environ - - self.name = name - self.is_set = False - self.value = None - - if name in environ: - self.is_set = True - self.value = environ[name] - else: - if "default" in kwargs: - self.is_set = True - self.value = kwargs["default"] - else: - self.is_set = False - self.value = None