Skip to content

Commit fc5b818

Browse files
author
David Stirling
committed
Fix saving hit table to database
1 parent a323602 commit fc5b818

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

cpa/dbconnect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def clean_up_colnames(colnames):
103103
don't have to be quoted in sql syntax'''
104104
colnames = [col.replace(' ','_') for col in colnames]
105105
colnames = [col.replace('\n','_') for col in colnames]
106-
colnames = [[c for c in col if re.match('[A-Za-z0-9_]',c)] for col in colnames]
106+
colnames = [''.join([c for c in col if re.match('[A-Za-z0-9_]',c)]) for col in colnames]
107107
return colnames
108108

109109

cpa/tableviewer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ def on_save_table_to_db(self, evt):
965965
data = [[self.grid.Table.GetValue(row, col)
966966
for col in range(self.grid.Table.GetNumberCols())]
967967
for row in range(self.grid.Table.GetNumberRows())]
968-
db.CreateTableFromData(data, dbconnect.clean_up_colnames(colnames),
968+
db.CreateTableFromData(data, colnames,
969969
tablename, temporary=temporary)
970970
self.Title = tablename
971971
try:

0 commit comments

Comments
 (0)