Skip to content

Commit

Permalink
fix sniffers of the triple format
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse c j van Dam committed Jun 24, 2015
1 parent 82f62bc commit 6c3cedc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/galaxy/datatypes/data.py
Expand Up @@ -884,7 +884,7 @@ def regex_line_dataprovider( self, dataset, **settings ):
dataset_source = dataproviders.dataset.DatasetDataProvider( dataset )
return dataproviders.line.RegexLineDataProvider( dataset_source, **settings )

def safe_readlines(self, path, num_lines=1, size=5 * 1024):
def __safe_readlines(self, path, num_lines=1, size=5 * 1024):
"""
Read lines from the start of a file but be sure to restrict the size of
memory that will be consumed and use proper file handling to ensure file
Expand All @@ -895,8 +895,11 @@ def safe_readlines(self, path, num_lines=1, size=5 * 1024):
lines = start_of_file.splitlines()
return lines[0:num_lines]

def safe_readlines(self, path, num_lines=1, size=5 * 1024):
return "".join( self.__safe_readlines( path, num_lines, size ) )

def safe_readline(self, path):
self.safe_readlines(path)[0]
return self.__safe_readlines(path)[0]


class GenericAsn1( Text ):
Expand Down

0 comments on commit 6c3cedc

Please sign in to comment.