def open(self, ga_engine): """ Open the database connection :param ga_engine: the GA Engine .. versionchanged:: 0.6 The method now receives the *ga_engine* parameter. """ if self.mysqldbmod is None: logging.debug("Loading MySQLdb module...") self.mysqldbmod = Util.importSpecial("MySQLdb") logging.debug("Opening database, host=%s", self.host) self.connection = self.mysqldbmod.connect(host=self.host, user=self.user, passwd=self.passwd, db=self.db, port=self.port) temp_stats = Statistics.Statistics() self.createStructure(temp_stats) if self.resetDB: self.resetStructure(Statistics.Statistics()) if self.resetIdentify: self.resetTableIdentify()
def open(self, ga_engine): """ Load the modules needed :param ga_engine: the GA Engine .. versionchanged:: 0.6 The method now receives the *ga_engine* parameter. """ if self.urllibmod is None: logging.debug("Loading urllib module...") self.urllibmod = Util.importSpecial("urllib")
def open(self, ga_engine): """ Open the XML RPC Server proxy :param ga_engine: the GA Engine .. versionchanged:: 0.6 The method now receives the *ga_engine* parameter. """ if self.xmlrpclibmod is None: logging.debug("Loding the xmlrpclib module...") self.xmlrpclibmod = Util.importSpecial("xmlrpclib") logging.debug("Opening the XML RPC Server Proxy on %s", self.url) self.proxy = self.xmlrpclibmod.ServerProxy(self.url, allow_none=True)
def open(self, ga_engine): """ Open the CSV file or creates a new file :param ga_engine: the GA Engine .. versionchanged:: 0.6 The method now receives the *ga_engine* parameter. """ if self.csvmod is None: logging.debug("Loading the csv module...") self.csvmod = Util.importSpecial("csv") logging.debug("Opening the CSV file to dump statistics [%s]", self.filename) open_mode = 'w' if self.reset else 'a' self.fHandle = open(self.filename, open_mode) self.csvWriter = self.csvmod.writer(self.fHandle, delimiter=';')
def open(self, ga_engine): """ Imports the VPython module and creates the four graph windows :param ga_engine: the GA Engine """ logging.debug("Loading visual.graph (VPython) module...") if self.vtkGraph is None: self.vtkGraph = Util.importSpecial("visual.graph").graph display_rawmin = self.makeDisplay("Raw Score (min)", 0, 0, ga_engine) display_rawmax = self.makeDisplay("Raw Score (max)", 0, 250, ga_engine) display_rawdev = self.makeDisplay("Raw Score (std. dev.)", 500, 0, ga_engine) display_rawavg = self.makeDisplay("Raw Score (avg)", 500, 250, ga_engine) self.curveMin = self.vtkGraph.gcurve(color=self.vtkGraph.color.red, gdisplay=display_rawmin) self.curveMax = self.vtkGraph.gcurve(color=self.vtkGraph.color.green, gdisplay=display_rawmax) self.curveDev = self.vtkGraph.gcurve(color=self.vtkGraph.color.blue, gdisplay=display_rawdev) self.curveAvg = self.vtkGraph.gcurve(color=self.vtkGraph.color.orange, gdisplay=display_rawavg)
def open(self, ga_engine): """ Open the database connection :param ga_engine: the GA Engine .. versionchanged:: 0.6 The method now receives the *ga_engine* parameter. """ if self.sqlite3mod is None: logging.debug("Loading sqlite3 module...") self.sqlite3mod = Util.importSpecial("sqlite3") logging.debug("Opening database, dbname=%s", self.dbName) self.connection = self.sqlite3mod.connect(self.dbName) temp_stats = Statistics.Statistics() if self.resetDB: self.resetStructure(Statistics.Statistics()) self.createStructure(temp_stats) if self.resetIdentify: self.resetTableIdentify()