create a Config and pass it to the Window

This commit is contained in:
Josh Holtrop 2011-03-19 21:16:17 -04:00
parent 08128f5be0
commit 3c6703771d
3 changed files with 8 additions and 2 deletions

View File

@ -1,4 +1,6 @@
import os
class Config: class Config:
def __init__(self, filename): def __init__(self, filename):
self.filename = filename self.filename = filename

View File

@ -4,10 +4,12 @@ import gobject
from datetime import * from datetime import *
from AboutWindow import AboutWindow from AboutWindow import AboutWindow
from Config import *
class Window: class Window:
def __init__(self, progName, ds): def __init__(self, progName, ds, config):
self.ds = ds self.ds = ds
self.config = config
self.shown_projects = [] self.shown_projects = []
self.taskStart = datetime.now() self.taskStart = datetime.now()
self.monday = \ self.monday = \

4
dwtt
View File

@ -6,6 +6,7 @@ import getopt
from Window import * from Window import *
from DataStore import * from DataStore import *
from Config import *
PROGRAM_NAME = 'dwtt' PROGRAM_NAME = 'dwtt'
@ -39,7 +40,8 @@ def main(argv):
conf_file = dbfile + '.conf' conf_file = dbfile + '.conf'
ds = DataStore(dbfile) ds = DataStore(dbfile)
w = Window(PROGRAM_NAME, ds) config = Config(conf_file)
w = Window(PROGRAM_NAME, ds, config)
w.main() w.main()
if __name__ == "__main__": if __name__ == "__main__":