Skip to content

Commit

Permalink
fix crash with strange tables
Browse files Browse the repository at this point in the history
  • Loading branch information
abretaud committed Aug 10, 2018
1 parent 78803b1 commit eb5bf9e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions biomaj2galaxy/commands/rm.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ def rm(ctx, dbkey, tables, exact):
continue

for line in tables_entries[table]:
if (exact and line[dbkey_field] == dbkey) or (not exact and line[dbkey_field].startswith(dbkey)):
print("Deleting from '" + table + "' table")
ctx.gi.tool_data.delete_data_table(table, "\t".join(line))
if len(line) > dbkey_field: # Sometimes Galaxy is lying (featurecounts_anno table)
if (exact and line[dbkey_field] == dbkey) or (not exact and line[dbkey_field].startswith(dbkey)):
print("Deleting from '" + table + "' table")
ctx.gi.tool_data.delete_data_table(table, "\t".join(line))

# Reload all tables just in case
time.sleep(1) # Reloading too soon might not work for some strange reason
Expand Down

0 comments on commit eb5bf9e

Please sign in to comment.