本文整理汇总了Python中sfdb.SpiderFootDb.scanInstanceDelete方法的典型用法代码示例。如果您正苦于以下问题:Python SpiderFootDb.scanInstanceDelete方法的具体用法?Python SpiderFootDb.scanInstanceDelete怎么用?Python SpiderFootDb.scanInstanceDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfdb.SpiderFootDb
的用法示例。
在下文中一共展示了SpiderFootDb.scanInstanceDelete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: scandelete
# 需要导入模块: from sfdb import SpiderFootDb [as 别名]
# 或者: from sfdb.SpiderFootDb import scanInstanceDelete [as 别名]
def scandelete(self, id, confirm=None):
dbh = SpiderFootDb(self.config)
res = dbh.scanInstanceGet(id)
if res == None:
return self.error("Scan ID not found.")
if confirm != None:
dbh.scanInstanceDelete(id)
raise cherrypy.HTTPRedirect("/")
else:
templ = Template(filename='dyn/scandelete.tmpl', lookup=self.lookup)
return templ.render(id=id, name=res[0])
示例2: scandelete
# 需要导入模块: from sfdb import SpiderFootDb [as 别名]
# 或者: from sfdb.SpiderFootDb import scanInstanceDelete [as 别名]
def scandelete(self, id, confirm=None):
dbh = SpiderFootDb(self.config)
res = dbh.scanInstanceGet(id)
if res is None:
return self.error("Scan ID not found.")
if confirm is not None:
dbh.scanInstanceDelete(id)
raise cherrypy.HTTPRedirect("/")
else:
templ = Template(filename='dyn/scandelete.tmpl', lookup=self.lookup)
return templ.render(id=id, name=res[0], names=list(), ids=list(),
pageid="SCANLIST", docroot=self.docroot)
示例3: scandelete
# 需要导入模块: from sfdb import SpiderFootDb [as 别名]
# 或者: from sfdb.SpiderFootDb import scanInstanceDelete [as 别名]
def scandelete(self, id, confirm=None, raw=False):
dbh = SpiderFootDb(self.config)
res = dbh.scanInstanceGet(id)
if res is None:
if not raw:
return self.error("Scan ID not found.")
else:
return json.dumps(["ERROR", "Scan ID not found."])
if confirm is not None:
dbh.scanInstanceDelete(id)
if not raw:
raise cherrypy.HTTPRedirect("/")
else:
return json.dumps(["SUCCESS", ""])
else:
templ = Template(filename='dyn/scandelete.tmpl', lookup=self.lookup)
return templ.render(id=id, name=unicode(res[0], 'utf-8', errors='replace'),
names=list(), ids=list(),
pageid="SCANLIST", docroot=self.docroot)
示例4: scandeletemulti
# 需要导入模块: from sfdb import SpiderFootDb [as 别名]
# 或者: from sfdb.SpiderFootDb import scanInstanceDelete [as 别名]
def scandeletemulti(self, ids, confirm=None):
dbh = SpiderFootDb(self.config)
names = list()
for id in ids.split(','):
res = dbh.scanInstanceGet(id)
names.append(res[0])
if res is None:
return self.error("Scan ID not found (" + id + ").")
if res[5] in [ "RUNNING", "STARTING", "STARTED" ]:
return self.error("You cannot delete running scans.")
if confirm is not None:
for id in ids.split(','):
dbh.scanInstanceDelete(id)
raise cherrypy.HTTPRedirect("/")
else:
templ = Template(filename='dyn/scandelete.tmpl', lookup=self.lookup)
return templ.render(id=None, name=None, ids=ids.split(','), names=names,
pageid="SCANLIST", docroot=self.docroot)