def runga(context): from iga.gacommon import gaParams filename = context.get('app_name', 'funcopt.yml') gaParams.fileArgs('config/' + filename) pop = gaParams.consoleGA() return pop
def init_iga(context): from iga.gacommon import gaParams filename = context.get('app_name', 'funcopt.yml') gaParams.fileArgs('config/%s' % (filename)) gaParams.onInit(context) return gaParams
def onOpenApp(self, event): ''' Load application specific config file. ''' dirname = getcwd() + '/config' dlg = wx.FileDialog(self, "Load Application File", dirname, "", 'YAML files (.yml)|*.yml|All files (*)|*', wx.OPEN) if dlg.ShowModal() == wx.ID_OK: filename = dlg.GetFilename() gaParams.reset() gaParams.fileArgs('config/' + filename) self.SetTitle('IGA Client - %s' % gaParams.getAppName()) dlg.Destroy()
if __name__ == "__main__": try: import psyco psyco.full() except: print 'No psyco! Oh well...' args = parse() from iga.gacommon import gaParams if args.has_key('config'): filename = args['config'] if not filename.startswith('config'): filename = 'config/' + filename gaParams.fileArgs(filename) else: gaParams.fileArgs('config/floorplan.yml') gaParams.setArgs(args) if gaParams.getVar('mode') == 'ga': gaParams.consoleGA() else: from gui import gawindow import wx app = wx.PySimpleApp() gaWindow = gawindow.GAWindow() gaWindow.SetFocus()