xxh/xonssh_xxh/settings.py

20 lines
458 B
Python
Raw Normal View History

2020-02-17 08:36:17 +00:00
import sys, os
2020-02-08 21:57:47 +00:00
global_settings = {
2020-02-17 09:09:54 +00:00
'XXH_VERSION': '0.2.10'
2020-02-08 21:57:47 +00:00
}
if __name__ == "__main__":
2020-02-13 19:16:03 +00:00
2020-02-17 08:36:17 +00:00
for e in ['XXH_HOME', 'PIP_TARGET', 'PYTHONPATH']:
if e in os.environ:
global_settings[e] = os.environ[e]
2020-02-08 21:57:47 +00:00
if len(sys.argv) > 1:
setting_name = sys.argv[1]
if setting_name in global_settings:
print(global_settings[setting_name])
else:
sys.exit(1)
else:
print(global_settings)