From 2f9c4e7df8a31e09e6d4f8800cafe6b83ebe8e97 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 21 Feb 2011 23:04:01 -0500 Subject: [PATCH] add initial Config class, calculate config fname --- Config.py | 6 ++++++ dwtt | 1 + 2 files changed, 7 insertions(+) create mode 100644 Config.py diff --git a/Config.py b/Config.py new file mode 100644 index 0000000..f85ac7d --- /dev/null +++ b/Config.py @@ -0,0 +1,6 @@ + +class Config: + def __init__(self, filename): + if os.path.isfile(filename): + f = open(filename, 'r') + eval(f, self) diff --git a/dwtt b/dwtt index 74ba19f..238c59a 100755 --- a/dwtt +++ b/dwtt @@ -37,6 +37,7 @@ def main(argv): usage() return 2 + conf_file = dbfile + '.conf' ds = DataStore(dbfile) w = Window(ds) w.main()