Ejemplo n.º 1
0
    def __init__(self, db_name, timeout=5):
        full_name, self.path, self.base_name, extension = utils.translate_name(
            db_name)

        self.db_name = "%s/%s.spgql" % (self.path, self.base_name)
        sim_name = "%s/%s.spg" % (self.path, self.base_name)

        MultIteratorParser.__init__(self, open(sim_name))
        #   print self.data
        # self.path, foo = os.path.split( os.path.abspath(db_name) )
        # self.base_name, foo = os.path.splitext( foo )
        #    print  check_params.consistency(self.command, self)
        if not check_params.consistency(self.command, self):
            utils.newline_msg("ERR",
                              "simulation configuration is not consistent.")
            sys.exit(1)

        all_outputs = check_params.read_output_configuration(self.command)

        self.stdout_contents = dict()
        for k in all_outputs:
            table = k.output_table
            if table not in self.stdout_contents.leys():
                self.stdout_contents[table] = k

        self.connection = sql.connect(self.db_name,
                                      timeout=timeout,
                                      check_same_thread=False)
        self.cursor = self.connection.cursor()
Ejemplo n.º 2
0
 def __init__(self, stream=None, db_name = "results.sqlite", timeout = 5):
     MultIteratorParser.__init__(self, stream)
 #    print  check_params.consistency(self.command, self)
     if not check_params.consistency(self.command, self):
         utils.newline_msg("ERR","parameters.dat file is not consistent.")
         sys.exit(1)
     self.stdout_contents = check_params.contents_in_output(self.command)
             
     self.connection =  sql.connect(db_name, timeout = timeout)
     self.cursor = self.connection.cursor()
Ejemplo n.º 3
0
    def __init__(self, db_name , timeout = 5):
        full_name, self.path, self.base_name, extension = utils.translate_name( db_name )

        self.db_name = "%s/%s.spgql"%(self.path, self.base_name)
        sim_name = "%s/%s.spg"%(self.path, self.base_name)

        MultIteratorParser.__init__(self, open(sim_name) )
        # self.path, foo = os.path.split( os.path.abspath(db_name) )
        # self.base_name, foo = os.path.splitext( foo )
    #    print  check_params.consistency(self.command, self)
        if not check_params.consistency(self.command, self):
            utils.newline_msg("ERR","simulation configuration is not consistent.")
            sys.exit(1)

        self.stdout_contents = check_params.contents_in_output(self.command)
                
        self.connection =  sql.connect(self.db_name, timeout = timeout, check_same_thread = False)
        self.cursor = self.connection.cursor()