def display(self,query, result): if not query.has_key('table'): result.heading("Delete a table from this case") def DeleteIcon(value): tmp=result.__class__(result) target = query.clone() target.set('table',value) tmp.link("Delete", icon="no.png", target=target) return tmp result.table( elements = [ ColumnType("Delete?",'table_name', callback = DeleteIcon), StringType("Table Name",'table_name'), StringType("Type", "preset"), ], table="log_tables", case=query['case'] ) elif query.has_key('confirm'): LogFile.drop_table(query['case'] , query['table']) result.refresh(0, query_type(family=query['family'], case=query['case'], report=query['report'])) else: result.heading("About to remove %s" % query['table']) query['confirm']=1 result.link("Are you sure you want to drop table %s. Click here to confirm"% query['table'], query)
def display(self, query, result): if not query.has_key('table'): result.heading("Delete a table from this case") def DeleteIcon(value): tmp = result.__class__(result) target = query.clone() target.set('table', value) tmp.link("Delete", icon="no.png", target=target) return tmp result.table(elements=[ ColumnType("Delete?", 'table_name', callback=DeleteIcon), StringType("Table Name", 'table_name'), StringType("Type", "preset"), ], table="log_tables", case=query['case']) elif query.has_key('confirm'): LogFile.drop_table(query['case'], query['table']) result.refresh( 0, query_type(family=query['family'], case=query['case'], report=query['report'])) else: result.heading("About to remove %s" % query['table']) query['confirm'] = 1 result.link( "Are you sure you want to drop table %s. Click here to confirm" % query['table'], query)
def execute(self): for table in self.args: yield "Deleting table %s" % table LogFile.drop_table(self.environment._CASE, table)