summaryrefslogtreecommitdiff
path: root/scripts/read_config.py
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2018-08-02 17:21:14 +0200
committerYves Fischer <yvesf-git@xapek.org>2018-08-02 17:59:06 +0200
commit74973624deed05d1cc8b297fb1d877cadad50969 (patch)
tree8304000f99a4dc0e0fad263fc9928d8e5ad6366c /scripts/read_config.py
downloadesp8266-74973624deed05d1cc8b297fb1d877cadad50969.tar.gz
esp8266-74973624deed05d1cc8b297fb1d877cadad50969.zip
new commit-history root - cleaned off passwordsHEADmaster
Diffstat (limited to 'scripts/read_config.py')
-rw-r--r--scripts/read_config.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/read_config.py b/scripts/read_config.py
new file mode 100644
index 0000000..de95af9
--- /dev/null
+++ b/scripts/read_config.py
@@ -0,0 +1,6 @@
+config = dict(map(lambda x: (x[0], int(x[1]) if x[1].isdecimal() else x[1][1:-1] if x[1].startswith('"') and x[1].endswith('"') else x[1]), map(lambda x: x.strip().split("=", 1), filter(lambda x: '=' in x, open(".config").readlines()))))
+
+if __name__ == "__main__":
+ import sys
+ if sys.argv[1] in config:
+ print(config[sys.argv[1]])