mirror of https://github.com/craigerl/aprsd.git
17 lines
370 B
Python
17 lines
370 B
Python
"""Utilities and helper functions."""
|
|
|
|
import os
|
|
import pprint
|
|
import sys
|
|
|
|
|
|
def env(*vars, **kwargs):
|
|
"""This returns the first environment variable set.
|
|
if none are non-empty, defaults to '' or keyword arg default
|
|
"""
|
|
for v in vars:
|
|
value = os.environ.get(v, None)
|
|
if value:
|
|
return value
|
|
return kwargs.get('default', '')
|