We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
config_prefix
1 parent b17ac35 commit fd10c47Copy full SHA for fd10c47
2 files changed
enapter/vucm/app.py
@@ -6,10 +6,10 @@
6
from .ucm import UCM
7
8
9
-async def run(device_factory):
+async def run(device_factory, config_prefix=None):
10
enapter.log.configure(level=enapter.log.LEVEL or "info")
11
12
- config = Config.from_env()
+ config = Config.from_env(prefix=config_prefix)
13
14
async with App(config=config, device_factory=device_factory) as app:
15
await app.join()
enapter/vucm/config.py
@@ -7,7 +7,9 @@
class Config:
@classmethod
- def from_env(cls, prefix="ENAPTER_VUCM_", env=os.environ):
+ def from_env(cls, prefix=None, env=os.environ):
+ if prefix is None:
+ prefix = "ENAPTER_VUCM_"
try:
blob = os.environ[prefix + "BLOB"]
except KeyError:
0 commit comments