diff options
Diffstat (limited to 'poezio/poezio.py')
-rw-r--r-- | poezio/poezio.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/poezio/poezio.py b/poezio/poezio.py index 51e10d1b..586130c8 100644 --- a/poezio/poezio.py +++ b/poezio/poezio.py @@ -37,6 +37,20 @@ Poezio is currently unable to read your input or draw its interface properly,\ so it will now exit.""") return False +def test_env(): + """ + Check if the environment has the right variables set + """ + unset = set() + for i in ('HOME', 'PATH', 'TERM'): + if not os.environ.get(i): + unset.add(i) + if unset: + variables = ', '.join('$%s' % i for i in unset) + print('ERROR: %s not set' % variables) + return False + return True + def main(): """ |