comparison contrib/deletebuild.py @ 864:a24744710a65

Fix printing of what will be deleted by deletebuild.
author hodgestar
date Mon, 18 Oct 2010 11:16:28 +0000
parents 9d65ffa31414
children
comparison
equal deleted inserted replaced
863:14010fa88b4b 864:a24744710a65
45 return all_files 45 return all_files
46 46
47 def discover(self, build): 47 def discover(self, build):
48 """Print a summary of what is linked to the build.""" 48 """Print a summary of what is linked to the build."""
49 print "Items to delete for build %r" % (build,) 49 print "Items to delete for build %r" % (build,)
50 print "-------------------------------"
50 51
51 db = self.env.get_db_cnx() 52 db = self.env.get_db_cnx()
52 cursor = db.cursor() 53 cursor = db.cursor()
53 54
54 print "Attachments for build resource:" 55 print "Attachments for build resource:"
55 cursor.execute("SELECT config FROM bitten_build WHERE id=%s", (build,)) 56 cursor.execute("SELECT config FROM bitten_build WHERE id=%s", (build,))
56 config = cursor.fetchone()[0] 57 config = cursor.fetchone()[0]
57 print "\n %s/%s" % (config, build) 58 print " %s/%s" % (config, build)
58 59
59 print "Log files:" 60 print "Log files:"
60 print "\n ".join(self._log_files(cursor, build)) 61 print " ", "\n ".join(self._log_files(cursor, build))
61 62
62 print "Rows from bitten_log with ids:" 63 print "Rows from bitten_log with ids:"
63 cursor.execute("SELECT id FROM bitten_log WHERE build=%s", (build,)) 64 cursor.execute("SELECT id FROM bitten_log WHERE build=%s", (build,))
64 print "\n ".join(row[0] for row in cursor.fetchall()) 65 print " ", "\n ".join(str(row[0]) for row in cursor.fetchall())
65 66
66 print "Rows from bitten_report with ids:" 67 print "Rows from bitten_report with ids:"
67 cursor.execute("SELECT id FROM bitten_report WHERE build=%s", (build,)) 68 cursor.execute("SELECT id FROM bitten_report WHERE build=%s", (build,))
68 print "\n ".join(row[0] for row in cursor.fetchall()) 69 print " ", "\n ".join(str(row[0]) for row in cursor.fetchall())
69 print "Rows from bitten_report_item with report set to these ids will" 70 print "Rows from bitten_report_item with report set to these ids will"
70 print "also be deleted." 71 print "also be deleted."
71 72
72 print "Rows from bitten_step for this build with names:" 73 print "Rows from bitten_step for this build with names:"
73 cursor.execute("SELECT name FROM bitten_step WHERE build=%s", (build,)) 74 cursor.execute("SELECT name FROM bitten_step WHERE build=%s", (build,))
74 print "\n ".join(row[0] for row in cursor.fetchall()) 75 print " ", "\n ".join(str(row[0]) for row in cursor.fetchall())
75 76
76 print "Row from bitten_build with id:" 77 print "Row from bitten_build with id:"
77 cursor.execute("SELECT name FROM bitten_step WHERE build=%s", (build,)) 78 cursor.execute("SELECT id FROM bitten_build WHERE id=%s", (build,))
78 print "\n ".join(row[0] for row in cursor.fetchall()) 79 print " ", "\n ".join(str(row[0]) for row in cursor.fetchall())
79 80
80 def remove(self, build): 81 def remove(self, build):
81 """Delete what is linked to the build.""" 82 """Delete what is linked to the build."""
82 print "Deleting items for build %r" % (build,) 83 print "Deleting items for build %r" % (build,)
83 84
Copyright (C) 2012-2017 Edgewall Software