DBSQLite.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:d-tailor 作者: jcg 项目源码 文件源码
def registerWorker(self):
        start_time = strftime("%Y-%m-%d %H:%M:%S %Z")
        hostname = check_output("hostname").rstrip()
        ip = gethostbyname(gethostname()).rstrip()

        self.cur.execute("insert into worker(worker_id, hostname, ip, time_start, time_finish) values (?,?,?,?,NULL);", 
                        (self.worker_id, hostname, ip, start_time) )

        self.cur.execute("select * from desired_solution")

        for row in self.cur.fetchall():
            key = str(row['des_solution_id'])                        
            self.des_solutions[key] = {'status': str(row['status']), 'des_solution_id': str(row['des_solution_id'])}

        self.cur.execute("select generated_solution_id from generated_solution")

        for row in self.cur.fetchall():                        
            self.gen_solutions_id[str(row['generated_solution_id'])] = '1'            

        return 0
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号