import repository from arizona
[raven.git] / tools / misc / arizonaconfigDebug.py
1 #! /usr/bin/env python
2 """
3 <Purpose>
4    This tool is used to experiment with arizonaconfig
5 """
6
7 #           [option, long option,     variable,      action,        data,     default,                           metavar,     description]
8 """arizonaconfig
9    options=[
10             ["-C",   "--configfile",  "configfile",  "store",       "string", "arizonaconfigDebug.conf", "FILE",   "use a different config file (arizonaconfigDebug.conf is the default)"],
11             ["",     "--append",      "append",      "append",       "string", None,                               None,        "append"],
12             ["",     "--append_def",  "append_def",  "append",       "string", ["one", "two"],                               None,        "append to a default list"],
13             ["",     "--storestr",    "storestr",    "store",        "string", "default",                          None,        "store a string"],
14             ["",     "--storeint",    "storeint",    "store",        "int",    1234,                               None,        "store an int"],
15             ["",     "--store_false", "store_false", "store_false",  None,     True,                               None,        "store a boolean"],
16             ["",     "--store_true",  "store_true",  "store_true",   None,     False,                              None,        "store a boolean"]]
17
18
19    includes=[]
20 """
21
22 import arizonaconfig
23
24 def main():
25    arizonaconfig.init_options("arizonaconfigDebug.py", configfile_optvar="configfile")
26
27    print "configfile", arizonaconfig.get_option("configfile")
28    print "append", arizonaconfig.get_option("append")
29    print "append_def", arizonaconfig.get_option("append_def")
30    print "storestr", arizonaconfig.get_option("storestr")
31    print "storeint", arizonaconfig.get_option("storeint")
32    print "store_true", arizonaconfig.get_option("store_true")
33    print "store_false", arizonaconfig.get_option("store_false")
34
35 if __name__ == "__main__":
36    main()