コード例 #1
0
ファイル: App.py プロジェクト: nicholasw-gc/hemelb
class SetupTool(wx.App):
    def __init__(self, args={}, profile=None, **kwargs):
        self.cmdLineArgs = args
        self.cmdLineProfileFile = profile
        
        wx.App.__init__(self, **kwargs)
        return
    
    def OnInit(self):
        # Model
        self.profile = Profile()
        
        self.pipeline = Pipeline()
        
        # Controller
        self.controller = ProfileController(self.profile)
        self.controller.Pipeline = PipelineController(self.pipeline, self.controller)
        
        # View
        self.view = MainWindow(self.controller)

        if self.cmdLineProfileFile is not None:
            # Load the profile
            self.profile.LoadFromFile(self.cmdLineProfileFile)
            pass
        
        # override any keys that have been set on cmdline.
        self.profile.UpdateAttributesBasedOnCmdLineArgs(self.cmdLineArgs)
        
        self.SetTopWindow(self.view)
        return True
    
    pass