git://git.onelab.eu
/
plstackapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
140f15a
)
a tool for fetching values from config file
author
Scott Baker
<smbaker@gmail.com>
Thu, 15 May 2014 22:29:47 +0000
(15:29 -0700)
committer
Scott Baker
<smbaker@gmail.com>
Thu, 15 May 2014 22:29:47 +0000
(15:29 -0700)
planetstack/planetstack-config.py
[new file with mode: 0755]
patch
|
blob
diff --git a/planetstack/planetstack-config.py
b/planetstack/planetstack-config.py
new file mode 100755
(executable)
index 0000000..
5bcb8fc
--- /dev/null
+++ b/
planetstack/planetstack-config.py
@@ -0,0
+1,24
@@
+import sys
+from planetstack.config import Config
+
+def help():
+ print "syntax: %s get name [default]" % sys.argv[0]
+
+def main():
+ c = Config()
+
+ if len(sys.argv)<=1:
+ help()
+ return
+
+ if sys.argv[1] == "get":
+ if len(sys.argv)==4:
+ print getattr(c, sys.argv[2], sys.argv[3])
+ elif len(sys.argv)==3:
+ print getattr(c, sys.argv[2])
+ else:
+ help()
+ else:
+ help()
+
+main()