From 5437b74d308e094780f3af1e10f9c306274d7018 Mon Sep 17 00:00:00 2001 From: Daniel Blankenberg Date: Tue, 16 Oct 2007 20:47:50 +0000 Subject: [PATCH] Fix for set_meta() for tabular based filetypes when file is empty. --- lib/galaxy/datatypes/interval.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/galaxy/datatypes/interval.py b/lib/galaxy/datatypes/interval.py index 02d86f216b2..bcdfaf6bdd8 100644 --- a/lib/galaxy/datatypes/interval.py +++ b/lib/galaxy/datatypes/interval.py @@ -236,6 +236,7 @@ class Bed( Interval ): the format of the file from BED to Interval. """ valid_bed_data = False + i = 0 if dataset.has_data(): for i, line in enumerate( file(dataset.file_name) ): line = line.rstrip('\r\n') @@ -389,6 +390,7 @@ class Gff( Tabular ): self.add_display_app ('gbrowse', 'display in GBrowse', 'as_gbrowse_display_file', 'gbrowse_links' ) def set_meta( self, dataset ): + i = 0 for i, line in enumerate( file ( dataset.file_name ) ): line = line.rstrip('\r\n') if line and not line.startswith( '#' ): @@ -511,6 +513,7 @@ class Gff3( Gff ): Gff.__init__(self, **kwd) def set_meta( self, dataset ): + i = 0 for i, line in enumerate( file ( dataset.file_name ) ): line = line.rstrip('\r\n') if line and not line.startswith( '#' ): @@ -608,6 +611,7 @@ class Wiggle( Tabular ): return Tabular.make_html_table(self, data, skipchar='#') def set_meta( self, dataset ): + i = 0 for i, line in enumerate( file ( dataset.file_name ) ): line = line.rstrip('\r\n') if line and not line.startswith( '#' ):