• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/python2
2from __future__ import absolute_import
3from __future__ import division
4from __future__ import print_function
5import os, sys, shutil
6thisdir = os.path.dirname(os.path.abspath(sys.argv[0]))
7sys.path.insert(0, os.path.abspath(os.path.join(thisdir, '../tko')))
8import db
9
10usage = "usage: delete_job_results <job tag>"
11
12if len(sys.argv) < 2:
13    print(usage)
14    sys.exit(2)
15tag = sys.argv[1]
16resultsdir = os.path.abspath(os.path.join(thisdir, '../results', tag))
17
18db = db.db()
19if not db.find_job(tag):
20    raise "Job tag %s does not exist in database" % tag
21
22db.delete_job(tag)
23shutil.rmtree(resultsdir)
24