本文整理汇总了Python中db.Db.selectInfo方法的典型用法代码示例。如果您正苦于以下问题:Python Db.selectInfo方法的具体用法?Python Db.selectInfo怎么用?Python Db.selectInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类db.Db
的用法示例。
在下文中一共展示了Db.selectInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from db import Db [as 别名]
# 或者: from db.Db import selectInfo [as 别名]
def run(self):
with self.threadingSum:
inst = LogBak()
inst.main(self.ip,self.path,self.regular,self.isdel,self.lbtid)
if __name__ == '__main__':
threadingSum = threading.Semaphore(1)
conn = Db()
#初始化
sql = "insert into sn_logbacktask (logbacktask_logbackid,logbacktask_status) \
select logback_id,'未开始' from sn_logback where logback_status = '正常' and logback_rate = 'hour'"
ret = conn.insertInfo(sql)
if ret == "I-SUCESS":
#获取任务列表
sql = "select lb.logback_ip,lb.logback_path,lb.logback_regular,lb.logback_isdel,lbt.logbacktask_id from sn_logback lb,sn_logbacktask lbt \
where lb.logback_id = lbt.logbacktask_logbackid and lb.logback_rate = 'hour' and lbt.logbacktask_status = '未开始'"
data = conn.selectInfo(sql)
if str(data) != "S-ERROR" and str(data) != "N-DATA":
for d in data:
ip,path,regular,isdel,lbtid = d[0],d[1],d[2],d[3],d[4]
t = LogBakThread(threadingSum,ip,path,regular,isdel,lbtid)
t.start()
for t in threading.enumerate():
if t is threading.currentThread():
continue
t.join()
else:
print "没有符合备份条件的记录."
else:
print "初始化失败."
conn.close()