mbligh | 96b9a5a | 2007-11-24 19:32:20 +0000 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | import os, sys, shutil |
| 3 | thisdir = os.path.dirname(os.path.abspath(sys.argv[0])) |
| 4 | sys.path.insert(0, os.path.abspath(os.path.join(thisdir, '../tko'))) |
| 5 | import db |
| 6 | |
| 7 | usage = "usage: delete_job_results <job tag>" |
| 8 | |
| 9 | if len(sys.argv) < 2: |
jadmanski | 0afbb63 | 2008-06-06 21:10:57 +0000 | [diff] [blame] | 10 | print usage |
| 11 | sys.exit(2) |
mbligh | 96b9a5a | 2007-11-24 19:32:20 +0000 | [diff] [blame] | 12 | tag = sys.argv[1] |
| 13 | resultsdir = os.path.abspath(os.path.join(thisdir, '../results', tag)) |
| 14 | |
mbligh | 96b9a5a | 2007-11-24 19:32:20 +0000 | [diff] [blame] | 15 | db = db.db() |
| 16 | if not db.find_job(tag): |
jadmanski | 0afbb63 | 2008-06-06 21:10:57 +0000 | [diff] [blame] | 17 | raise "Job tag %s does not exist in database" % tag |
mbligh | 96b9a5a | 2007-11-24 19:32:20 +0000 | [diff] [blame] | 18 | |
mbligh | 96b9a5a | 2007-11-24 19:32:20 +0000 | [diff] [blame] | 19 | db.delete_job(tag) |
mbligh | 7a41a86 | 2007-11-30 17:44:24 +0000 | [diff] [blame] | 20 | shutil.rmtree(resultsdir) |