コード例 #1
0
    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:
            log.debug("Loading MySQLdb module...")
            self.mysqldbmod = utils.importSpecial("MySQLdb")

        log.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()
コード例 #2
0
    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:
            log.debug("Loading urllib module...")
            self.urllibmod = utils.importSpecial("urllib")
コード例 #3
0
ファイル: DBAdapters.py プロジェクト: Stargrazer82301/CAAPR
   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:
         log.debug("Loading urllib module...")
         self.urllibmod = utils.importSpecial("urllib")
コード例 #4
0
    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:
            log.debug("Loding the xmlrpclib module...")
            self.xmlrpclibmod = utils.importSpecial("xmlrpclib")

        log.debug("Opening the XML RPC Server Proxy on %s", self.url)
        self.proxy = self.xmlrpclibmod.ServerProxy(self.url, allow_none=True)
コード例 #5
0
ファイル: DBAdapters.py プロジェクト: Stargrazer82301/CAAPR
   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:
         log.debug("Loding the xmlrpclib module...")
         self.xmlrpclibmod = utils.importSpecial("xmlrpclib")

      log.debug("Opening the XML RPC Server Proxy on %s", self.url)
      self.proxy = self.xmlrpclibmod.ServerProxy(self.url, allow_none=True)
コード例 #6
0
ファイル: DBAdapters.py プロジェクト: Stargrazer82301/CAAPR
    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:
         log.debug("Loading the csv module...")
         self.csvmod = utils.importSpecial("csv")

      log.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=';')
コード例 #7
0
    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:
            log.debug("Loading the csv module...")
            self.csvmod = utils.importSpecial("csv")

        log.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=';')
コード例 #8
0
ファイル: DBAdapters.py プロジェクト: Stargrazer82301/CAAPR
   def open(self, ga_engine):
      """ Imports the VPython module and creates the four graph windows

      :param ga_engine: the GA Engine
      """
      log.debug("Loading visual.graph (VPython) module...")
      if self.vtkGraph is None:
         self.vtkGraph = utils.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)
コード例 #9
0
    def open(self, ga_engine):
        """ Imports the VPython module and creates the four graph windows

      :param ga_engine: the GA Engine
      """
        log.debug("Loading visual.graph (VPython) module...")
        if self.vtkGraph is None:
            self.vtkGraph = utils.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)
コード例 #10
0
    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:
            log.debug("Loading sqlite3 module...")
            self.sqlite3mod = utils.importSpecial("sqlite3")

        log.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()
コード例 #11
0
ファイル: DBAdapters.py プロジェクト: Stargrazer82301/CAAPR
   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:
         log.debug("Loading MySQLdb module...")
         self.mysqldbmod = utils.importSpecial("MySQLdb")

      log.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()
コード例 #12
0
ファイル: DBAdapters.py プロジェクト: Stargrazer82301/CAAPR
   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:
         log.debug("Loading sqlite3 module...")
         self.sqlite3mod = utils.importSpecial("sqlite3")

      log.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()